[LL FIR] LLFirContractsLazyResolver: avoid transformation for primary constructors

Primary constructors can't have any contracts.
This change also should improve memory consumption because we will
less frequently calculate bodies.

^KT-55750
This commit is contained in:
Dmitrii Gridin
2023-09-20 14:21:39 +02:00
committed by Space Team
parent d5047bfa90
commit 850201a65c
39 changed files with 125 additions and 113 deletions
@@ -176,8 +176,8 @@ FILE: [ResolvedTo(IMPORTS)] primaryConstructorPropertyScript.kts
[ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(STATUS)] class A : R|kotlin/Any| {
public [ResolvedTo(CONTRACTS)] [ContainingClassKey=A] constructor([ResolvedTo(CONTRACTS)] a: R|kotlin/Boolean|, [ResolvedTo(CONTRACTS)] [CorrespondingProperty=/A.prop] prop: R|kotlin/Int| = IntegerLiteral(42)): R|A| {
super<R|kotlin/Any|>()
public [ResolvedTo(CONTRACTS)] [ContainingClassKey=A] constructor([ResolvedTo(CONTRACTS)] a: R|kotlin/Boolean|, [ResolvedTo(CONTRACTS)] [CorrespondingProperty=/A.prop] prop: R|kotlin/Int| = LAZY_EXPRESSION): R|A| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val prop: R|kotlin/Int| = R|<local>/prop|
@@ -195,8 +195,8 @@ FILE: [ResolvedTo(IMPORTS)] primaryConstructorPropertyScript.kts
[ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(STATUS)] class A : R|kotlin/Any| {
public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [ContainingClassKey=A] constructor([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] a: R|kotlin/Boolean|, [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [CorrespondingProperty=/A.prop] prop: R|kotlin/Int| = IntegerLiteral(42)): R|A| {
super<R|kotlin/Any|>()
public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [ContainingClassKey=A] constructor([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] a: R|kotlin/Boolean|, [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [CorrespondingProperty=/A.prop] prop: R|kotlin/Int| = LAZY_EXPRESSION): R|A| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val prop: R|kotlin/Int| = R|<local>/prop|
@@ -214,8 +214,8 @@ FILE: [ResolvedTo(IMPORTS)] primaryConstructorPropertyScript.kts
[ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(STATUS)] class A : R|kotlin/Any| {
public [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] [ContainingClassKey=A] constructor([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] a: R|kotlin/Boolean|, [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] [CorrespondingProperty=/A.prop] prop: R|kotlin/Int| = IntegerLiteral(42)): R|A| {
super<R|kotlin/Any|>()
public [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] [ContainingClassKey=A] constructor([ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] a: R|kotlin/Boolean|, [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] [CorrespondingProperty=/A.prop] prop: R|kotlin/Int| = LAZY_EXPRESSION): R|A| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val prop: R|kotlin/Int| = R|<local>/prop|
@@ -264,3 +264,4 @@ FILE: [ResolvedTo(BODY_RESOLVE)] primaryConstructorPropertyScript.kts
}
}