Report error on callable reference or class literal with "-no-stdlib"

Also workaround the NoSuchElementException that was happening because error
type never has any type arguments

 #KT-14547 Fixed
This commit is contained in:
Alexander Udalov
2017-01-30 13:24:17 +03:00
parent 7371dc9b54
commit 8811165de8
3 changed files with 19 additions and 3 deletions
+1
View File
@@ -2,5 +2,6 @@ import kotlin.reflect.*
fun foo() {
String::class.primaryConstructor
::foo.isExternal
listOf(42)
}
+7 -1
View File
@@ -1,7 +1,13 @@
compiler/testData/cli/jvm/noStdlib.kt:1:8: error: unresolved reference: kotlin
import kotlin.reflect.*
^
compiler/testData/cli/jvm/noStdlib.kt:5:5: error: unresolved reference: listOf
compiler/testData/cli/jvm/noStdlib.kt:4:5: error: cannot access class 'kotlin.reflect.KClass'. Check your module classpath for missing or conflicting dependencies
String::class.primaryConstructor
^
compiler/testData/cli/jvm/noStdlib.kt:5:5: error: cannot access class 'kotlin.reflect.KCallable'. Check your module classpath for missing or conflicting dependencies
::foo.isExternal
^
compiler/testData/cli/jvm/noStdlib.kt:6:5: error: unresolved reference: listOf
listOf(42)
^
COMPILATION_ERROR