[IR] Initialize IrFunction.returnType eagerly, when possible
This commit is contained in:
committed by
Space Team
parent
392fa8f9bd
commit
e9005e4fed
+1
-2
@@ -296,7 +296,7 @@ internal class FunctionGenerator(declarationGenerator: DeclarationGenerator) : D
|
||||
visibility = visibility,
|
||||
isInline = isInline,
|
||||
isExpect = isExpect,
|
||||
returnType = null,
|
||||
returnType = constructorDescriptor.returnType.toIrType(),
|
||||
symbol = it,
|
||||
isPrimary = isPrimary,
|
||||
isExternal = isEffectivelyExternal(),
|
||||
@@ -310,7 +310,6 @@ internal class FunctionGenerator(declarationGenerator: DeclarationGenerator) : D
|
||||
if (context.configuration.generateBodies) {
|
||||
irConstructor.body = createBodyGenerator(irConstructor.symbol).generateBody(irConstructor)
|
||||
}
|
||||
irConstructor.returnType = constructorDescriptor.returnType.toIrType()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -180,7 +180,7 @@ internal class StandaloneDeclarationGenerator(private val context: GeneratorCont
|
||||
visibility = visibility,
|
||||
isInline = isInline,
|
||||
isExpect = isExpect,
|
||||
returnType = null,
|
||||
returnType = descriptor.returnType.toIrType(),
|
||||
symbol = symbol,
|
||||
isPrimary = isPrimary,
|
||||
isExternal = isEffectivelyExternal(),
|
||||
@@ -192,7 +192,6 @@ internal class StandaloneDeclarationGenerator(private val context: GeneratorCont
|
||||
val ctorTypeParameters = descriptor.typeParameters.filter { it.containingDeclaration === descriptor }
|
||||
generateScopedTypeParameterDeclarations(irConstructor, ctorTypeParameters)
|
||||
generateValueParameterDeclarations(irConstructor, descriptor, defaultArgumentFactory)
|
||||
irConstructor.returnType = descriptor.returnType.toIrType()
|
||||
}
|
||||
|
||||
return irConstructor
|
||||
|
||||
+1
-2
@@ -94,7 +94,7 @@ internal interface DescriptorToIrTranslationMixin {
|
||||
visibility,
|
||||
isInline,
|
||||
isExpect,
|
||||
null,
|
||||
constructorDescriptor.returnType.toIrType(),
|
||||
it,
|
||||
isPrimary,
|
||||
isEffectivelyExternal(),
|
||||
@@ -109,7 +109,6 @@ internal interface DescriptorToIrTranslationMixin {
|
||||
it.parent = irConstructor
|
||||
}
|
||||
}
|
||||
irConstructor.returnType = constructorDescriptor.returnType.toIrType()
|
||||
irConstructor.generateAnnotations()
|
||||
return irConstructor
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user