diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt new file mode 100644 index 00000000000..a0bad3d1016 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt @@ -0,0 +1,7 @@ +package a + +class List(val head: T, val tail: List? = null) + +fun List.map1(f: (T)-> Q): List? = tail!!.map1(f) + +fun List.map2(f: (T)-> Q): List? = tail.sure().map2(f) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt new file mode 100644 index 00000000000..4e615b73d2e --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt @@ -0,0 +1,9 @@ +package a + +fun fooT2() : (t : T) -> T { + return {it} +} + +fun test() { + fooT2()(1) // here 1 should not be marked with an error +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt943.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt943.kt new file mode 100644 index 00000000000..9508c0a686a --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt943.kt @@ -0,0 +1,17 @@ +package maze + +//+JDK +import java.util.Collections.* +import java.util.* + +fun foo(lines: List) { + val w = max(lines, comparator {o1, o2 -> + val l1 : Int = o1.length // Types of o1 and o2 are ERROR + val l2 = o2.length + l1 - l2 + }).sure() + w : String +} + +//standard library +public inline fun comparator(fn: (T,T) -> Int): Comparator {} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 260dc17023d..6f8442680ff 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -1375,6 +1375,26 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage doTest("compiler/testData/diagnostics/tests/inference/regressions/kt731.kt"); } + @TestMetadata("kt742.kt") + public void testKt742() throws Exception { + doTest("compiler/testData/diagnostics/tests/inference/regressions/kt742.kt"); + } + + @TestMetadata("kt832.kt") + public void testKt832() throws Exception { + doTest("compiler/testData/diagnostics/tests/inference/regressions/kt832.kt"); + } + + @TestMetadata("kt943.kt") + public void testKt943() throws Exception { + doTest("compiler/testData/diagnostics/tests/inference/regressions/kt943.kt"); + } + + @TestMetadata("kt948.kt") + public void testKt948() throws Exception { + doTest("compiler/testData/diagnostics/tests/inference/regressions/kt948.kt"); + } + } public static Test innerSuite() {