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:
Yan Zhulanow
2016-05-17 20:39:53 +03:00
parent 8caee7940e
commit d1447faf2b
3 changed files with 7 additions and 2 deletions
@@ -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 -> {