K2: fix reporting of NO_REFLECTION_IN_CLASS_PATH on implicit invoke
#KT-61054 Fixed
This commit is contained in:
committed by
Space Team
parent
87ab88957d
commit
e87bccd5c7
+1
-1
@@ -46,7 +46,7 @@ abstract class AbstractFirReflectionApiCallChecker : FirBasicExpressionChecker()
|
|||||||
if (containingClassId == null || containingClassId.packageFqName != StandardNames.KOTLIN_REFLECT_FQ_NAME) return
|
if (containingClassId == null || containingClassId.packageFqName != StandardNames.KOTLIN_REFLECT_FQ_NAME) return
|
||||||
|
|
||||||
if (!isAllowedReflectionApi(referencedSymbol.name, containingClassId, context)) {
|
if (!isAllowedReflectionApi(referencedSymbol.name, containingClassId, context)) {
|
||||||
report(resolvedReference.source, context, reporter)
|
report(resolvedReference.source ?: expression.source, context, reporter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -21,6 +21,7 @@ fun y01() = Foo::prop.<!NO_REFLECTION_IN_CLASS_PATH!>getter<!>
|
|||||||
fun y02() = Foo::class.<!NO_REFLECTION_IN_CLASS_PATH!>members<!>
|
fun y02() = Foo::class.<!NO_REFLECTION_IN_CLASS_PATH!>members<!>
|
||||||
fun y03() = Foo::class.simpleName
|
fun y03() = Foo::class.simpleName
|
||||||
fun y04() = Foo::class.<!UNRESOLVED_REFERENCE!>properties<!>
|
fun y04() = Foo::class.<!UNRESOLVED_REFERENCE!>properties<!>
|
||||||
|
fun y05() = Foo::prop.<!NO_REFLECTION_IN_CLASS_PATH!>getter<!>(Foo(42))
|
||||||
|
|
||||||
fun <T : Any> kclass(k: KClass<*>, kt: KClass<T>) {
|
fun <T : Any> kclass(k: KClass<*>, kt: KClass<T>) {
|
||||||
k.simpleName
|
k.simpleName
|
||||||
|
|||||||
+2
@@ -16,6 +16,7 @@ public fun y01(): kotlin.reflect.KProperty1.Getter<Foo, kotlin.Any>
|
|||||||
public fun y02(): kotlin.collections.Collection<kotlin.reflect.KCallable<*>>
|
public fun y02(): kotlin.collections.Collection<kotlin.reflect.KCallable<*>>
|
||||||
public fun y03(): kotlin.String?
|
public fun y03(): kotlin.String?
|
||||||
public fun y04(): [Error type: Return type for function cannot be resolved]
|
public fun y04(): [Error type: Return type for function cannot be resolved]
|
||||||
|
public fun y05(): kotlin.Any
|
||||||
|
|
||||||
public final class Foo {
|
public final class Foo {
|
||||||
public constructor Foo(/*0*/ prop: kotlin.Any)
|
public constructor Foo(/*0*/ prop: kotlin.Any)
|
||||||
@@ -25,3 +26,4 @@ public final class Foo {
|
|||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user