Fix test data around flexibility after ae39d748e4

This commit is contained in:
victor.petukhov
2020-02-10 19:23:35 +03:00
committed by Victor Petukhov
parent dc2a9cdc81
commit b8aacf0786
3 changed files with 40 additions and 2 deletions
@@ -0,0 +1,18 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
// Issue: KT-36254
// FILE: Convertor.java
public interface Convertor<Src, Dst> {
Dst convert(Src o);
}
// FILE: main.kt
fun takeConvertor(c: Convertor<String, String>) {}
fun main() {
takeConvertor(Convertor { null })
}
@@ -0,0 +1,20 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
// Issue: KT-36254
// FILE: Convertor.java
public interface Convertor<Src, Dst> {
Out<Dst> convert(Out<Src> o);
}
// FILE: main.kt
fun takeConvertor(c: Convertor<String, String>) {}
class Out<out T> {}
fun main(o: Out<Nothing?>) {
takeConvertor(Convertor { o })
}
+2 -2
View File
@@ -1,5 +1,5 @@
// ERROR: Type mismatch: inferred type is (Any?..Any?) but String was expected
// ERROR: Type mismatch: inferred type is (Any?..Any?) but String was expected
// ERROR: Type mismatch: inferred type is (Any?..Any?) but String! was expected
// ERROR: Type mismatch: inferred type is (Any?..Any?) but String! was expected
// ERROR: Type mismatch: inferred type is HashMap<String, Any?> but Map<String, String> was expected
import java.util.*