[FIR] Don't create delegating super constructor call to kotlin.Enum for enums

This commit is contained in:
Dmitriy Novozhilov
2019-12-05 12:30:49 +03:00
parent a0d8e5bde7
commit d840671620
23 changed files with 84 additions and 83 deletions
@@ -387,9 +387,9 @@ class DeclarationsConverter(
val selfType = null.toDelegatedSelfType(firClass)
val defaultDelegatedSuperTypeRef = when {
modifiers.isEnum() && (classKind == ClassKind.ENUM_CLASS) ->
FirResolvedTypeRefImpl(
when {
modifiers.isEnum() && (classKind == ClassKind.ENUM_CLASS) -> {
superTypeRefs += FirResolvedTypeRefImpl(
source = null,
ConeClassLikeTypeImpl(
implicitEnumType.type.lookupTag,
@@ -397,12 +397,12 @@ class DeclarationsConverter(
isNullable = false
)
)
}
modifiers.isAnnotation() && (classKind == ClassKind.ANNOTATION_CLASS) -> {
superTypeRefs += implicitAnnotationType
implicitAnyType
}
else -> implicitAnyType
}
val defaultDelegatedSuperTypeRef = implicitAnyType
superTypeRefs.ifEmpty { superTypeRefs += defaultDelegatedSuperTypeRef }