diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.fir.kt new file mode 100644 index 00000000000..754b5196000 --- /dev/null +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.fir.kt @@ -0,0 +1,18 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_PARAMETER + +// Issue: KT-36254 + +// FILE: Convertor.java + +public interface Convertor { + Dst convert(Src o); +} + +// FILE: main.kt + +fun takeConvertor(c: Convertor) {} + +fun main() { + takeConvertor(Convertor { null }) +} diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.fir.kt new file mode 100644 index 00000000000..fb3e0dcba7f --- /dev/null +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.fir.kt @@ -0,0 +1,20 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_PARAMETER + +// Issue: KT-36254 + +// FILE: Convertor.java + +public interface Convertor { + Out convert(Out o); +} + +// FILE: main.kt + +fun takeConvertor(c: Convertor) {} + +class Out {} + +fun main(o: Out) { + takeConvertor(Convertor { o }) +} diff --git a/j2k/testData/fileOrElement/typeParameters/rawTypeCast.kt b/j2k/testData/fileOrElement/typeParameters/rawTypeCast.kt index 4a0aa43fe18..5379d45dc09 100644 --- a/j2k/testData/fileOrElement/typeParameters/rawTypeCast.kt +++ b/j2k/testData/fileOrElement/typeParameters/rawTypeCast.kt @@ -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 but Map was expected import java.util.*