Fix #KT-12015 (Kotlin Lint False Positive for Bundle.getInt()).
Android firstly checks API version against the function call receiver type, so we should do the same to be consistent. (cherry picked from commit c3d01ec) (cherry picked from commit 5c78acc)
This commit is contained in:
@@ -166,7 +166,8 @@ open class ApiDetector : Detector(), UastScanner {
|
||||
|
||||
val parentClass = declaration.parent as? UClass ?: return
|
||||
if (!isSdkClass(parentClass) || checkAosp(parentClass)) return
|
||||
val parentInternalName = parentClass.internalName ?: return
|
||||
val parentInternalName = (node as? UCallExpression)?.getReceiver()?.getExpressionType()?.resolveClass(context)?.internalName
|
||||
?: parentClass.internalName ?: return
|
||||
|
||||
when (declaration) {
|
||||
is UFunction -> {
|
||||
|
||||
Reference in New Issue
Block a user