[FIR] Don't initialize type of FirAnonymousObjectExpression

In some cases we check that some declaration (e.g. field) was
  analyzed by checking type of it's body/initializer (is it implicit
  or not), so if type of FirAnonymousObjectExpression is not implicit
  we can skip resolve of anonymous object itself
This commit is contained in:
Dmitriy Novozhilov
2021-07-02 12:54:47 +03:00
parent 32173a408a
commit 43fe0c3bc1
2 changed files with 2 additions and 3 deletions
@@ -595,7 +595,6 @@ class DeclarationsConverter(
annotations += modifiers.annotations
this.superTypeRefs += superTypeRefs
this@buildAnonymousObjectExpression.typeRef = delegatedSelfType
val classWrapper = ClassWrapper(
SpecialNames.NO_NAME_PROVIDED, modifiers, ClassKind.OBJECT, this,
@@ -982,7 +982,8 @@ open class RawFirBuilder(
scopeProvider = baseScopeProvider
symbol = FirAnonymousObjectSymbol()
context.applyToActualCapturedTypeParameters(false) {
typeParameters += buildOuterClassTypeParameterRef { symbol = it } }
typeParameters += buildOuterClassTypeParameterRef { symbol = it }
}
val delegatedSelfType = objectDeclaration.toDelegatedSelfType(this)
registerSelfType(delegatedSelfType)
objectDeclaration.extractAnnotationsTo(this)
@@ -993,7 +994,6 @@ open class RawFirBuilder(
ClassKind.CLASS,
containerTypeParameters = emptyList()
)
this@buildAnonymousObjectExpression.typeRef = delegatedSelfType
for (declaration in objectDeclaration.declarations) {
declarations += declaration.toFirDeclaration(