FIR: provide resolved super-type as the type of enum entry reference

This commit is contained in:
Simon Ogorodnik
2019-04-25 14:23:41 +03:00
committed by Mikhail Glukhikh
parent 8e200d8113
commit adf845b2fd
@@ -166,10 +166,19 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
if (symbol is ConeCallableSymbol) { if (symbol is ConeCallableSymbol) {
jump.tryCalculateReturnType(symbol.firUnsafe()) jump.tryCalculateReturnType(symbol.firUnsafe())
} else if (symbol is ConeClassifierSymbol) { } else if (symbol is ConeClassifierSymbol) {
FirResolvedTypeRefImpl( val firUnsafe = symbol.firUnsafe()
session, null, symbol.constructType(emptyArray(), isNullable = false), // TODO: unhack
isMarkedNullable = false, annotations = emptyList() if (firUnsafe is FirEnumEntry) {
) (firUnsafe.superTypeRefs.firstOrNull() as? FirResolvedTypeRef) ?: FirErrorTypeRefImpl(
session,
null,
"no enum item supertype"
)
} else
FirResolvedTypeRefImpl(
session, null, symbol.constructType(emptyArray(), isNullable = false),
isMarkedNullable = false, annotations = emptyList()
)
} else { } else {
error("WTF ! $symbol") error("WTF ! $symbol")
} }