Introduce NoLookupLocation and some new constants to classify LookupLocation.NO_LOCATION usages
This commit is contained in:
@@ -105,7 +105,7 @@ abstract class KCallableContainerImpl : DeclarationContainerImpl {
|
||||
|
||||
fun findPropertyDescriptor(name: String, signature: String): PropertyDescriptor {
|
||||
val properties = scope
|
||||
.getProperties(Name.guess(name))
|
||||
.getProperties(Name.guess(name), NO_LOCATION_FROM_REFLECTION)
|
||||
.filter { descriptor ->
|
||||
descriptor is PropertyDescriptor &&
|
||||
RuntimeTypeMapper.mapPropertySignature(descriptor).asString() == signature
|
||||
@@ -123,7 +123,7 @@ abstract class KCallableContainerImpl : DeclarationContainerImpl {
|
||||
}
|
||||
|
||||
fun findFunctionDescriptor(name: String, signature: String): FunctionDescriptor {
|
||||
val functions = (if (name == "<init>") constructorDescriptors.toList() else scope.getFunctions(Name.guess(name)))
|
||||
val functions = (if (name == "<init>") constructorDescriptors.toList() else scope.getFunctions(Name.guess(name), NO_LOCATION_FROM_REFLECTION))
|
||||
.filter { descriptor ->
|
||||
RuntimeTypeMapper.mapSignature(descriptor).asString() == signature
|
||||
}
|
||||
|
||||
@@ -16,11 +16,14 @@
|
||||
|
||||
package kotlin.reflect.jvm.internal
|
||||
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import kotlin.reflect.IllegalCallableAccessException
|
||||
|
||||
internal val PLATFORM_STATIC = FqName("kotlin.platform.platformStatic")
|
||||
|
||||
internal val NO_LOCATION_FROM_REFLECTION = NoLookupLocation.create("from reflection")
|
||||
|
||||
// TODO: wrap other exceptions
|
||||
internal inline fun <R> reflectionCall(block: () -> R): R =
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user