FIR: Reorder when entries in ConeTypeContext::typeConstructor

More expected types should be checked first
This commit is contained in:
Denis Zharkov
2019-12-13 17:25:31 +03:00
parent a14852a6ec
commit 1790dcf80c
@@ -130,11 +130,11 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty
override fun SimpleTypeMarker.typeConstructor(): TypeConstructorMarker {
return when (this) {
is ConeCapturedType -> constructor
is ConeTypeVariableType -> lookupTag as ConeTypeVariableTypeConstructor // TODO: WTF
is ConeClassLikeType -> lookupTag.toSymbol(session)
?: ErrorTypeConstructor("Unresolved: $lookupTag")
is ConeLookupTagBasedType -> lookupTag.toSymbol(session) ?: ErrorTypeConstructor("Unresolved: $lookupTag")
is ConeTypeParameterType -> lookupTag.typeParameterSymbol
is ConeCapturedType -> constructor
is ConeTypeVariableType -> lookupTag as ConeTypeVariableTypeConstructor // TODO: WTF
is ConeIntersectionType -> this
is ConeStubType -> variable.typeConstructor
is ConeDefinitelyNotNullType -> original.typeConstructor()