Cleanup code in EffectiveVisibility.kt and extract descriptors related part to separate file

This commit is contained in:
Dmitriy Novozhilov
2020-09-01 11:12:28 +03:00
parent 6346b1b2ab
commit 7d9b7df3b4
3 changed files with 152 additions and 134 deletions
@@ -160,6 +160,22 @@ object AbstractTypeChecker {
return AbstractTypeChecker.isSubtypeOf(context.newBaseTypeCheckerContext(true, stubTypesEqualToAnything), subType, superType)
}
fun isSubtypeOfClass(
context: AbstractTypeCheckerContext,
typeConstructor: TypeConstructorMarker,
superConstructor: TypeConstructorMarker
): Boolean {
if (typeConstructor == superConstructor) return true
with(context) {
for (superType in typeConstructor.supertypes()) {
if (isSubtypeOfClass(context, superType.typeConstructor(), superConstructor)) {
return true
}
}
}
return false
}
fun equalTypes(
context: TypeCheckerProviderContext,
a: KotlinTypeMarker,