From 71b2e8bcf1439fa2777060d7b0073058edf5eb1a Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 19 Nov 2014 21:51:14 +0300 Subject: [PATCH] Test for substitutions with dynamic types --- .../diagnostics/tests/dynamicTypes/substitution.kt | 11 +++++++++++ .../diagnostics/tests/dynamicTypes/substitution.txt | 11 +++++++++++ .../jet/checkers/JetDiagnosticsTestGenerated.java | 6 ++++++ 3 files changed, 28 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/dynamicTypes/substitution.kt create mode 100644 compiler/testData/diagnostics/tests/dynamicTypes/substitution.txt diff --git a/compiler/testData/diagnostics/tests/dynamicTypes/substitution.kt b/compiler/testData/diagnostics/tests/dynamicTypes/substitution.kt new file mode 100644 index 00000000000..80a781f96a4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/dynamicTypes/substitution.kt @@ -0,0 +1,11 @@ +// !MARK_DYNAMIC_CALLS + +// MODULE[js]: m1 +// FILE: k.kt + +fun foo(d: dynamic) { + Foo(d).p.bar() + +} + +class Foo(val p: T) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/dynamicTypes/substitution.txt b/compiler/testData/diagnostics/tests/dynamicTypes/substitution.txt new file mode 100644 index 00000000000..bc5fee32ff2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/dynamicTypes/substitution.txt @@ -0,0 +1,11 @@ +package + +internal fun foo(/*0*/ d: dynamic): kotlin.Unit + +internal final class Foo { + public constructor Foo(/*0*/ p: T) + internal final val p: T + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 6950e05375e..b6afd4c6fd5 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -3794,6 +3794,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("substitution.kt") + public void testSubstitution() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dynamicTypes/substitution.kt"); + doTest(fileName); + } + @TestMetadata("unsupported.kt") public void testUnsupported() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dynamicTypes/unsupported.kt");