Create error supertype instead of non-checked supertypes to avoid cyclic hierarchy in subtyping.
This commit is contained in:
@@ -28,7 +28,7 @@ abstract class AbstractTypeConstructor(storageManager: StorageManager) : TypeCon
|
|||||||
private class Supertypes(
|
private class Supertypes(
|
||||||
val allSupertypes: Collection<KotlinType>) {
|
val allSupertypes: Collection<KotlinType>) {
|
||||||
// initializer is only needed as a stub for case when 'getSupertypes' is called while 'supertypes' are being calculated
|
// initializer is only needed as a stub for case when 'getSupertypes' is called while 'supertypes' are being calculated
|
||||||
var supertypesWithoutCycles: List<KotlinType> = (allSupertypes as? List<KotlinType>) ?: allSupertypes.toList()
|
var supertypesWithoutCycles: List<KotlinType> = listOf(ERROR_TYPE)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val supertypes = storageManager.createLazyValueWithPostCompute(
|
private val supertypes = storageManager.createLazyValueWithPostCompute(
|
||||||
|
|||||||
Reference in New Issue
Block a user