From 0ebc478d507a5e1b280570c016b646035b758617 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Thu, 13 Nov 2014 03:47:29 +0200 Subject: [PATCH] Test for dynamic calls with lambdas --- .../dynamicTypes/dynamicCallsWithLambdas.kt | 16 ++++++++++++++++ .../dynamicTypes/dynamicCallsWithLambdas.txt | 3 +++ .../checkers/JetDiagnosticsTestGenerated.java | 6 ++++++ 3 files changed, 25 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/dynamicTypes/dynamicCallsWithLambdas.kt create mode 100644 compiler/testData/diagnostics/tests/dynamicTypes/dynamicCallsWithLambdas.txt diff --git a/compiler/testData/diagnostics/tests/dynamicTypes/dynamicCallsWithLambdas.kt b/compiler/testData/diagnostics/tests/dynamicTypes/dynamicCallsWithLambdas.kt new file mode 100644 index 00000000000..fded5ea995a --- /dev/null +++ b/compiler/testData/diagnostics/tests/dynamicTypes/dynamicCallsWithLambdas.kt @@ -0,0 +1,16 @@ +// MODULE[js]: m1 +// FILE: k.kt + +fun test(d: dynamic) { + d.foo {} + + d.foo { it } + + d.foo { x -> } + + d.foo { (x: Int) -> "" } + + d.foo { x, y -> "" } + + d.foo { (x: String, y: Int) -> "" } +} diff --git a/compiler/testData/diagnostics/tests/dynamicTypes/dynamicCallsWithLambdas.txt b/compiler/testData/diagnostics/tests/dynamicTypes/dynamicCallsWithLambdas.txt new file mode 100644 index 00000000000..41a648f7f82 --- /dev/null +++ b/compiler/testData/diagnostics/tests/dynamicTypes/dynamicCallsWithLambdas.txt @@ -0,0 +1,3 @@ +package + +internal fun test(/*0*/ d: dynamic): kotlin.Unit diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 2bdabaa077d..56caafd45a0 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -3728,6 +3728,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("dynamicCallsWithLambdas.kt") + public void testDynamicCallsWithLambdas() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dynamicTypes/dynamicCallsWithLambdas.kt"); + doTest(fileName); + } + @TestMetadata("dynamicSafeCalls.kt") public void testDynamicSafeCalls() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dynamicTypes/dynamicSafeCalls.kt");