Open
Description
How can I get "pattern matching for instanceof" working?
The issue #2345 states that "You can use post-Java11 features that are implemented by javac, like switch expressions, text blocks, and pattern matching for instanceof."
I have j2objc master compiled with jdk 17, running with Java 17, it silently converts pattern matching for instanceof but the variable to which it should be casted, is not declared in objc output. For example:
if ( o instanceof List l ) {
l.clear();
}
is converted to (regardless -XDallVersions -source 17 options):
if ([o isKindOfClass:[JavaUtilArrayList class]]) {
[l clear];
}
Metadata
Metadata
Assignees
Labels
No labels