If all supertypes are errors, do not leave the supertype list empty
This commit is contained in:
+4
-1
@@ -146,7 +146,7 @@ class LazyJavaClassDescriptor(
|
|||||||
else {
|
else {
|
||||||
val jlObject = innerC.javaClassResolver.resolveClassByFqName(JavaSupertypeResolver.OBJECT_FQ_NAME)?.getDefaultType()
|
val jlObject = innerC.javaClassResolver.resolveClassByFqName(JavaSupertypeResolver.OBJECT_FQ_NAME)?.getDefaultType()
|
||||||
// If java.lang.Object is not found, we simply use Any to recover
|
// If java.lang.Object is not found, we simply use Any to recover
|
||||||
emptyOrSingletonList(jlObject ?: KotlinBuiltIns.getInstance().getAnyType())
|
listOf(jlObject ?: KotlinBuiltIns.getInstance().getAnyType())
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
supertypes.iterator()
|
supertypes.iterator()
|
||||||
@@ -156,6 +156,9 @@ class LazyJavaClassDescriptor(
|
|||||||
}
|
}
|
||||||
.filter { supertype -> !supertype.isError() }
|
.filter { supertype -> !supertype.isError() }
|
||||||
.toList()
|
.toList()
|
||||||
|
.ifEmpty {
|
||||||
|
listOf(KotlinBuiltIns.getInstance().getAnyType())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getSupertypes(): Collection<JetType> = _supertypes()
|
override fun getSupertypes(): Collection<JetType> = _supertypes()
|
||||||
|
|||||||
Reference in New Issue
Block a user