Add call checker to report error more granulary if possible

This, however, works only for calls of 'synchronized' only. Thus, it
does not support inline functions of any kind.
This commit is contained in:
Ilmir Usmanov
2018-09-28 21:20:40 +03:00
parent 281f09f077
commit 9af7316845
21 changed files with 327 additions and 86 deletions
@@ -44,4 +44,12 @@ fun ModuleDescriptor.getContinuationOfTypeOrAny(kotlinType: KotlinType, isReleas
it,
arguments = listOf(kotlinType.asTypeProjection())
)
} ?: module.builtIns.nullableAnyType
} ?: module.builtIns.nullableAnyType
fun DeclarationDescriptor.isTopLevelInPackage(name: String, packageName: String): Boolean {
if (name != this.name.asString()) return false
val containingDeclaration = containingDeclaration as? PackageFragmentDescriptor ?: return false
val packageFqName = containingDeclaration.fqName.asString()
return packageName == packageFqName
}