From 891e1fb59b86dd24516e3fe96379effb85f463cf Mon Sep 17 00:00:00 2001 From: Dmitrii Gridin Date: Wed, 8 Nov 2023 14:45:34 +0100 Subject: [PATCH] [LL FIR] do not render redundant phases during lazy resolution tests There is no sense to rendering phases which are lower than the base one because the output will be the same as the baseline ^KT-63042 --- .../lazyResolve/delegateWithImplicitType.txt | 102 ---- ...gateWithImplicitTypeInDifferentModules.txt | 114 ---- .../delegateWithImplicitTypeScript.txt | 139 +---- .../localFunctionInsideStatement.txt | 474 +-------------- .../testData/lazyResolve/statement.txt | 539 ------------------ .../testData/lazyResolve/statement2.txt | 386 +------------ .../lazyResolve/substitutionFakeOverride.txt | 126 ---- .../substitutionFakeOverrideFunction.txt | 114 ---- ...substitutionFakeOverrideFunctionScript.txt | 150 ----- ...onFakeOverrideFunctionWithImplicitType.txt | 126 ---- ...OverrideFunctionWithImplicitTypeScript.txt | 162 ------ ...titutionFakeOverrideInDifferentModules.txt | 138 ----- .../substitutionFakeOverrideScript.txt | 162 ------ ...bstitutionFakeOverrideWithImplicitType.txt | 138 ----- ...akeOverrideWithImplicitTypeAndReceiver.txt | 138 ----- ...rrideWithImplicitTypeAndReceiverScript.txt | 175 +----- ...tionFakeOverrideWithImplicitTypeScript.txt | 175 +----- .../explicitReturnType.txt | 84 --- .../explicitReturnTypeAndAnnotations.txt | 150 ----- .../implicitReturnType.txt | 84 --- .../implicitReturnTypeAndAnnotations.txt | 162 ------ ...plicitReturnTypeAndAnnotationsAsGetter.txt | 156 ----- .../secondGenerationOverride.txt | 264 --------- .../setterAndExplicitReturnType.txt | 102 ---- ...terAndExplicitReturnTypeAndAnnotations.txt | 204 ------- ...plicitReturnTypeAndAnnotationsAsGetter.txt | 192 ------- ...plicitReturnTypeAndAnnotationsAsSetter.txt | 192 ------- ...LazyDeclarationResolveOverAllPhasesTest.kt | 4 +- 28 files changed, 8 insertions(+), 4944 deletions(-) diff --git a/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitType.txt b/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitType.txt index 2574475c15a..79fb6b5a385 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitType.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitType.txt @@ -1,105 +1,3 @@ -RAW_FIR: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -IMPORTS: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -COMPILER_REQUIRED_ANNOTATIONS: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -COMPANION_GENERATION: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -SUPER_TYPES: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -TYPES: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - STATUS: TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): diff --git a/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitTypeInDifferentModules.txt b/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitTypeInDifferentModules.txt index 8bd23c664e2..598d147dd0a 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitTypeInDifferentModules.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitTypeInDifferentModules.txt @@ -1,117 +1,3 @@ -RAW_FIR: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] Interface.kt - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -FILE: [ResolvedTo(IMPORTS)] usage.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - -IMPORTS: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] Interface.kt - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -FILE: [ResolvedTo(IMPORTS)] usage.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - -COMPILER_REQUIRED_ANNOTATIONS: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] Interface.kt - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -FILE: [ResolvedTo(IMPORTS)] usage.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - -COMPANION_GENERATION: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] Interface.kt - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -FILE: [ResolvedTo(IMPORTS)] usage.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - -SUPER_TYPES: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] Interface.kt - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -FILE: [ResolvedTo(IMPORTS)] usage.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - -TYPES: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] Interface.kt - public abstract [ResolvedTo(STATUS)] interface Interface : R|kotlin/Any| { - public open [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } - - } - -FILE: [ResolvedTo(IMPORTS)] usage.kt - public final [ResolvedTo(STATUS)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { - public [ResolvedTo(STATUS)] [ContainingClassKey=Aaa] constructor([ResolvedTo(STATUS)] i: R|Interface|): R|Aaa| { - LAZY_super<> - } - - private final [ResolvedTo(STATUS)] field $$delegate_0: R|Interface| = LAZY_EXPRESSION - - } - STATUS: TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): diff --git a/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitTypeScript.txt b/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitTypeScript.txt index 3e516506c90..a08e4cf76e0 100644 --- a/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitTypeScript.txt +++ b/analysis/low-level-api-fir/testData/lazyResolve/delegateWithImplicitTypeScript.txt @@ -1,141 +1,3 @@ -RAW_FIR: -TARGET: public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): - -FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitTypeScript.kts - context(