From 663752f086afa64ecabacacd6cd1639989237d78 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Wed, 29 Jun 2016 19:20:55 +0300 Subject: [PATCH] Create error supertype instead of non-checked supertypes to avoid cyclic hierarchy in subtyping. --- .../src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt b/core/descriptors/src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt index 869a69883f0..c6b64deb0a4 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/AbstractTypeConstructor.kt @@ -28,7 +28,7 @@ abstract class AbstractTypeConstructor(storageManager: StorageManager) : TypeCon private class Supertypes( val allSupertypes: Collection) { // initializer is only needed as a stub for case when 'getSupertypes' is called while 'supertypes' are being calculated - var supertypesWithoutCycles: List = (allSupertypes as? List) ?: allSupertypes.toList() + var supertypesWithoutCycles: List = listOf(ERROR_TYPE) } private val supertypes = storageManager.createLazyValueWithPostCompute(