added test for nontrivial nested calls

This commit is contained in:
Svetlana Isakova
2013-07-24 13:32:35 +04:00
parent 919714e027
commit 0609f61ee7
2 changed files with 23 additions and 0 deletions
@@ -0,0 +1,18 @@
package a
fun foo(l: List<Int>): Int = l.get(0)
fun <T> emptyList(): List<T> = throw Exception()
fun <T: Any> makeNullable(<!UNUSED_PARAMETER!>t<!>: T): T? = null
fun bar(i: Int) = i
fun bar(a: Any) = a
fun test(array: Array<Int>) {
bar(array[foo(emptyList())])
bar(foo(emptyList()) + foo(a.emptyList()))
bar(makeNullable(foo(emptyList())) ?: 0)
}
@@ -2861,6 +2861,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
doTest("compiler/testData/diagnostics/tests/inference/nestedCalls/kt3461checkTypes.kt");
}
@TestMetadata("nontrivialCallExpression.kt")
public void testNontrivialCallExpression() throws Exception {
doTest("compiler/testData/diagnostics/tests/inference/nestedCalls/nontrivialCallExpression.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/inference/regressions")