explicit right to left side assignment failure when inference breaks on return type (IDEA-152677)

This commit is contained in:
Anna.Kozlova
2017-03-27 10:31:26 +02:00
parent a03fffe024
commit 95226c21c5
4 changed files with 12 additions and 4 deletions

View File

@@ -7,7 +7,8 @@ abstract class Test {
abstract <T> T test(Serializable type);
private void call(){
String s = <error descr="no instance(s) of type variable(s) exist so that String[] conforms to String
String s = <error descr="Incompatible types. Required String but 'test' was inferred to T:
no instance(s) of type variable(s) exist so that String[] conforms to String
inference variable T has incompatible bounds:
equality constraints: String[]
upper bounds: Object, String">test(String[].class);</error>

View File

@@ -9,7 +9,8 @@ class A {
<error descr="Missing return statement">}</error>);
Map<Integer, Integer> map = Stream.iterate(5, <error descr="no instance(s) of type variable(s) T exist so that Stream<T> conforms to Map<Integer, Integer>">t -> t + 5</error>);
Map<Integer, Integer> map = Stream.iterate(5, <error descr="Incompatible types. Required Map<Integer, Integer> but 'iterate' was inferred to Stream<T>:
no instance(s) of type variable(s) T exist so that Stream<T> conforms to Map<Integer, Integer>">t -> t + 5</error>);
}