java highlighting: provide better incompatible types message on failed inference

GitOrigin-RevId: 5f97ec808f753d9ca40c417704ec93a802512745
This commit is contained in:
Anna Kozlova
2019-07-08 12:04:21 +03:00
committed by intellij-monorepo-bot
parent 6a7856d5c6
commit afa0706bfc
28 changed files with 87 additions and 101 deletions
@@ -7,10 +7,8 @@ public class Sample {
<B> B bar(G<B> gb) {return null;}
void f(G1 g1) {
G<String> l11 = <error descr="Incompatible types. Required G<String> but 'bar' was inferred to B:
Incompatible types: Object is not convertible to G<String>">bar(g1);</error>
String l1 = <error descr="Incompatible types. Required String but 'bar' was inferred to B:
Incompatible types: Object is not convertible to String">bar(g1);</error>
G<String> l11 = <error descr="Incompatible types. Found: 'java.lang.Object', required: 'Sample.G<java.lang.String>'">bar(g1);</error>
String l1 = <error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.String'">bar(g1);</error>
Object o = bar(g1);
}
}