FIR: provide resolved super-type as the type of enum entry reference
This commit is contained in:
committed by
Mikhail Glukhikh
parent
8e200d8113
commit
adf845b2fd
+13
-4
@@ -166,10 +166,19 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
|
||||
if (symbol is ConeCallableSymbol) {
|
||||
jump.tryCalculateReturnType(symbol.firUnsafe())
|
||||
} else if (symbol is ConeClassifierSymbol) {
|
||||
FirResolvedTypeRefImpl(
|
||||
session, null, symbol.constructType(emptyArray(), isNullable = false),
|
||||
isMarkedNullable = false, annotations = emptyList()
|
||||
)
|
||||
val firUnsafe = symbol.firUnsafe()
|
||||
// TODO: unhack
|
||||
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 {
|
||||
error("WTF ! $symbol")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user