Is your feature request related to a problem? Please describe.
the 'auto' not support for record pattern(destructuring)
if (obj instanceof Test(String str, var obj)) { ... }
Describe the solution you'd like
support auto in record pattern
if (test instanceof Test(auto str, auto obj)) {
...
}
Describe alternatives you've considered
explicitly write the types or use var keyword
Additional context
Example
public class Test {
public static void main(String[] args) {
Test test = new Test("", 1);
if (test instanceof Test(auto str, auto num)) {
System.out.println(str + " | " + num);
}
}
record Test(String str, float num) {}
}
Is your feature request related to a problem? Please describe.
the 'auto' not support for record pattern(destructuring)
if (obj instanceof Test(String str, var obj)) { ... }Describe the solution you'd like
support auto in record pattern
Describe alternatives you've considered
explicitly write the types or use
varkeywordAdditional context
Example