-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
None
When I try to compile the attached Hello.java file with javac It prints the following message:
```
Hello.java:22: error: incompatible types: INT#1 cannot be converted to int
return (x == y) ?
^
where INT#1,INT#2 are intersection types:
INT#1 extends Object,Serializable,Comparable<? extends INT#2>,Constable
INT#2 extends Object,Serializable,Comparable<?>,Constable
1 error
```
The return expression in the test case contains an error, it tries to cast an integer to a boolean automatically, however the message that javac prints doesn't hint on that problem IMO and the "^" is not pointing to the correct place in the expression where the error is.
```
Hello.java:22: error: incompatible types: INT#1 cannot be converted to int
return (x == y) ?
^
where INT#1,INT#2 are intersection types:
INT#1 extends Object,Serializable,Comparable<? extends INT#2>,Constable
INT#2 extends Object,Serializable,Comparable<?>,Constable
1 error
```
The return expression in the test case contains an error, it tries to cast an integer to a boolean automatically, however the message that javac prints doesn't hint on that problem IMO and the "^" is not pointing to the correct place in the expression where the error is.