JS backend: report diagnostic when try to get referenece on builtin members instead of crash with Exception.

This commit is contained in:
Zalim Bashorov
2015-03-16 22:24:32 +03:00
parent 975c4ffab5
commit 8421a15521
7 changed files with 42 additions and 19 deletions
@@ -0,0 +1,4 @@
$TESTDATA_DIR$/diagnosticWhenReferenceToBuiltinsMember.kt
-no-stdlib
-output
$TEMP_DIR$/out.js
@@ -0,0 +1,6 @@
package foo
fun test() {
Int::toByte
String::length
}
@@ -0,0 +1,5 @@
WARNING: compiler/testData/cli/js/diagnosticWhenReferenceToBuiltinsMember.kt: (4, 5) The expression is unused
ERROR: compiler/testData/cli/js/diagnosticWhenReferenceToBuiltinsMember.kt: (4, 8) Reflection types can't be loaded. Please ensure that you have Kotlin Runtime in your classpath
WARNING: compiler/testData/cli/js/diagnosticWhenReferenceToBuiltinsMember.kt: (5, 5) The expression is unused
ERROR: compiler/testData/cli/js/diagnosticWhenReferenceToBuiltinsMember.kt: (5, 11) Reflection types can't be loaded. Please ensure that you have Kotlin Runtime in your classpath
COMPILATION_ERROR
@@ -195,6 +195,12 @@ public class KotlincExecutableTestGenerated extends AbstractKotlincExecutableTes
doJsTest(fileName);
}
@TestMetadata("diagnosticWhenReferenceToBuiltinsMember.args")
public void testDiagnosticWhenReferenceToBuiltinsMember() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/js/diagnosticWhenReferenceToBuiltinsMember.args");
doJsTest(fileName);
}
@TestMetadata("jsExtraHelp.args")
public void testJsExtraHelp() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/js/jsExtraHelp.args");