-
Bug
-
Resolution: Fixed
-
P4
-
None
-
generic
-
generic
While compiling:
public class X {
public static void main(String [] args) {
Object o = args;
if (o __matches int s) {
System.out.println("Broken");
} else {
System.out.println("!Broken");
}
}
}
I get:
/home/srikanth/tmp/X.java:4: error: bad operand types for binary operator '=='
if (o __matches int s) {
^
first type: int
second type: Object
1 error
This is surprising.
public class X {
public static void main(String [] args) {
Object o = args;
if (o __matches int s) {
System.out.println("Broken");
} else {
System.out.println("!Broken");
}
}
}
I get:
/home/srikanth/tmp/X.java:4: error: bad operand types for binary operator '=='
if (o __matches int s) {
^
first type: int
second type: Object
1 error
This is surprising.