If all supertypes are errors, do not leave the supertype list empty

This commit is contained in:
Andrey Breslav
2013-11-07 18:49:17 +04:00
parent 6915773150
commit b16b9c58e1
@@ -146,7 +146,7 @@ class LazyJavaClassDescriptor(
else {
val jlObject = innerC.javaClassResolver.resolveClassByFqName(JavaSupertypeResolver.OBJECT_FQ_NAME)?.getDefaultType()
// If java.lang.Object is not found, we simply use Any to recover
emptyOrSingletonList(jlObject ?: KotlinBuiltIns.getInstance().getAnyType())
listOf(jlObject ?: KotlinBuiltIns.getInstance().getAnyType())
}
else
supertypes.iterator()
@@ -156,6 +156,9 @@ class LazyJavaClassDescriptor(
}
.filter { supertype -> !supertype.isError() }
.toList()
.ifEmpty {
listOf(KotlinBuiltIns.getInstance().getAnyType())
}
}
override fun getSupertypes(): Collection<JetType> = _supertypes()