Test for using dynamic types in conditions

This commit is contained in:
Andrey Breslav
2014-11-21 17:26:30 +03:00
parent ea36024893
commit 8cf6d24ffe
3 changed files with 22 additions and 0 deletions
@@ -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) {}
}
@@ -0,0 +1,3 @@
package
internal fun test(/*0*/ d: dynamic, /*1*/ b: kotlin.Boolean?): kotlin.Unit
@@ -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");