Support KClass.isInstance/cast/safeCast in stdlib-only reflection implementation

#KT-14720 Fixed
This commit is contained in:
Alexander Udalov
2019-10-24 19:37:29 +02:00
parent 5c89f2fa54
commit 896512f7cd
10 changed files with 80 additions and 42 deletions
@@ -48,7 +48,7 @@ abstract class AbstractReflectionApiCallChecker(
private val kClass by storageManager.createLazyValue { reflectionTypes.kClass }
protected open fun isAllowedKClassMember(name: Name): Boolean =
name.asString() == "simpleName"
name.asString() == "simpleName" || name.asString() == "isInstance"
final override fun check(resolvedCall: ResolvedCall<*>, reportOn: PsiElement, context: CallCheckerContext) {
if (isWholeReflectionApiAvailable) return