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:
@@ -1,3 +0,0 @@
|
||||
$TESTDATA_DIR$/noReflectionInClasspath.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -1,4 +0,0 @@
|
||||
class Foo(val prop: Any)
|
||||
|
||||
fun t1() = Foo::prop
|
||||
fun t2() = Foo::class
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user