diff --git a/compiler/testData/diagnostics/tests/dynamicTypes/conditions.kt b/compiler/testData/diagnostics/tests/dynamicTypes/conditions.kt new file mode 100644 index 00000000000..5e63620068c --- /dev/null +++ b/compiler/testData/diagnostics/tests/dynamicTypes/conditions.kt @@ -0,0 +1,13 @@ +// MODULE[js]: m1 +// FILE: k.kt + +fun test(d: dynamic, b: Boolean?) { + if (d) {} + while (d) {} + do {} while (d) + + if (d || false) {} + if (d && true) {} + if (d ?: true) {} + if (b ?: d) {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/dynamicTypes/conditions.txt b/compiler/testData/diagnostics/tests/dynamicTypes/conditions.txt new file mode 100644 index 00000000000..bbc95e31765 --- /dev/null +++ b/compiler/testData/diagnostics/tests/dynamicTypes/conditions.txt @@ -0,0 +1,3 @@ +package + +internal fun test(/*0*/ d: dynamic, /*1*/ b: kotlin.Boolean?): kotlin.Unit diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 6961b0ce177..1b25fc29cb5 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -3734,6 +3734,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("conditions.kt") + public void testConditions() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dynamicTypes/conditions.kt"); + doTest(fileName); + } + @TestMetadata("dynamicCalls.kt") public void testDynamicCalls() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dynamicTypes/dynamicCalls.kt");