diff --git a/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt b/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt new file mode 100644 index 00000000000..1c2d8a25779 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt @@ -0,0 +1,19 @@ +package conflictingSubstitutions +//+JDK + +import java.util.* + +fun elemAndList(r: R, t: List): R = r +fun R.elemAndListWithReceiver(r: R, t: List): R = r + +fun test() { + val s = elemAndList(11, list("72")) + + val u = 11.elemAndListWithReceiver(4, list("7")) +} + +fun list(value: T) : ArrayList { + val list = ArrayList() + list.add(value) + return list +} diff --git a/compiler/testData/diagnostics/tests/inference/noInformationForParameter.kt b/compiler/testData/diagnostics/tests/inference/noInformationForParameter.kt new file mode 100644 index 00000000000..af53ae4ba5e --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/noInformationForParameter.kt @@ -0,0 +1,14 @@ +package noInformationForParameter +//+JDK + +import java.util.* + +fun test() { + val n = newList() + + val n1 : List = newList() +} + +fun newList() : ArrayList { + return ArrayList() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt b/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt new file mode 100644 index 00000000000..1f672624e48 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt @@ -0,0 +1,13 @@ +package typeConstructorMismatch +//+JDK + +import java.util.* + +fun test(set: Set) { + elemAndList("2", set) + + "".elemAndListWithReceiver("", set) +} + +fun elemAndList(r: R, t: List): R = r +fun R.elemAndListWithReceiver(r: R, t: List): R = r