Make "reflection not found" a warning, provide a quick fix

Reporting the warning on each "::", as ReflectionNotFoundInspection did, is not
correct anymore, because for example name/get/set on properties works perfectly
without kotlin-reflect.jar in the classpath. So instead we report the warning
on calls to functions from reflection interfaces. This is not perfect either
because it's wrong in projects with custom implementations of reflection
interfaces, but this case is so rare that the users can suppress the warning
there anyway

 #KT-7176 Fixed
This commit is contained in:
Alexander Udalov
2015-07-02 17:39:16 +03:00
parent 4f1247f03f
commit 636b63a8c5
24 changed files with 240 additions and 261 deletions
@@ -1,3 +0,0 @@
$TESTDATA_DIR$/noReflectionInClasspath.kt
-d
$TEMP_DIR$
-4
View File
@@ -1,4 +0,0 @@
class Foo(val prop: Any)
fun t1() = Foo::prop
fun t2() = Foo::class
-7
View File
@@ -1,7 +0,0 @@
compiler/testData/cli/jvm/noReflectionInClasspath.kt:3:12: error: expression 'Foo::prop' uses reflection which is not found in compilation classpath. Make sure you have kotlin-reflect.jar in the classpath
fun t1() = Foo::prop
^
compiler/testData/cli/jvm/noReflectionInClasspath.kt:4:12: error: expression 'Foo::class' uses reflection which is not found in compilation classpath. Make sure you have kotlin-reflect.jar in the classpath
fun t2() = Foo::class
^
COMPILATION_ERROR