From f74d4494aa99e63276d0e1b1ad9f9c90353d29fc Mon Sep 17 00:00:00 2001 From: Dmitrii Gridin Date: Tue, 20 Jun 2023 17:04:40 +0200 Subject: [PATCH] [LL FIR] fix designation path for synthetic declarations A designation path for synthetic declarations like fake override or member delegate contained the wrong FirFile, because it was provided by the original declaration that is wrong. So we should pick up the file from our path, because it shouldn't be synthetic ^KT-59505 Fixed --- .../low/level/api/fir/api/FirDesignation.kt | 2 +- .../lazyResolve/delegateWithImplicitType.kt | 7 + .../lazyResolve/delegateWithImplicitType.txt | 257 ++++++++++++++ ...egateWithImplicitTypeInDifferentModules.kt | 11 + ...gateWithImplicitTypeInDifferentModules.txt | 193 ++++++++++ .../lazyResolve/substitutionFakeOverride.kt | 6 + .../lazyResolve/substitutionFakeOverride.txt | 304 ++++++++++++++++ ...stitutionFakeOverrideInDifferentModules.kt | 11 + ...titutionFakeOverrideInDifferentModules.txt | 178 ++++++++++ ...ubstitutionFakeOverrideWithImplicitType.kt | 7 + ...bstitutionFakeOverrideWithImplicitType.txt | 332 ++++++++++++++++++ .../AbstractFirLazyDeclarationResolveTest.kt | 6 +- ...stractFirLazyDeclarationResolveTestCase.kt | 73 +++- ...StdLibSourcesLazyDeclarationResolveTest.kt | 4 +- ...otLazyDeclarationResolveTestGenerated.java | 30 ++ ...ceLazyDeclarationResolveTestGenerated.java | 30 ++ .../base/AbstractLowLevelApiSingleFileTest.kt | 4 +- .../resolve/substitution/ConeSubstitutor.kt | 1 + .../org/jetbrains/kotlin/fir/ClassMembers.kt | 6 +- 19 files changed, 1445 insertions(+), 17 deletions(-) create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.kt create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.txt create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.kt create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.txt create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.kt create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.txt create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.kt create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.txt create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.kt create mode 100644 analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.txt diff --git a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/api/FirDesignation.kt b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/api/FirDesignation.kt index ec33d73abc0..c5cba80bdb8 100644 --- a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/api/FirDesignation.kt +++ b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/api/FirDesignation.kt @@ -274,7 +274,7 @@ fun FirElementWithResolveState.tryCollectDesignationWithFile(): FirDesignationWi } is FirDeclaration -> { val path = collectDesignationPath(this) ?: return null - val firFile = getContainingFile() ?: return null + val firFile = path.lastOrNull()?.getContainingFile() ?: getContainingFile() ?: return null FirDesignationWithFile(path, this, firFile) } else -> unexpectedElementError(this) diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.kt b/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.kt new file mode 100644 index 00000000000..43abf54d4cd --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.kt @@ -0,0 +1,7 @@ +// MEMBER_NAME_FILTER: implicitType + +class Aaa(i: Interface) : Interface by i + +interface Interface { + fun implicitType() = 42 +} diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.txt b/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.txt new file mode 100644 index 00000000000..4373702ac3f --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.txt @@ -0,0 +1,257 @@ +RAW_FIR: +TARGET: public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 } + + } + +EXPECT_ACTUAL_MATCHING: +TARGET: public open [ResolvedTo(EXPECT_ACTUAL_MATCHING)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 } + + } + +ARGUMENTS_OF_ANNOTATIONS: +TARGET: public open [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 } + + } + +CONTRACTS: +TARGET: public open [ResolvedTo(CONTRACTS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 } + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +TARGET: public open [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): R|kotlin/Int| + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitType(): R|kotlin/Int| { + ^implicitType Int(42) + } + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +TARGET: public open [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): R|kotlin/Int| + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitType(): R|kotlin/Int| { + ^implicitType Int(42) + } + + } + +BODY_RESOLVE: +TARGET: public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): R|kotlin/Int| + +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitType(): R|kotlin/Int| { + ^implicitType Int(42) + } + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(IMPORTS)] delegateWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public final [ResolvedTo(BODY_RESOLVE)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Aaa] constructor([ResolvedTo(BODY_RESOLVE)] i: R|Interface|): R|Aaa| { + super() + } + + private final [ResolvedTo(BODY_RESOLVE)] field $$delegate_0: R|Interface| = R|/i| + + } + public abstract [ResolvedTo(BODY_RESOLVE)] interface Interface : R|kotlin/Any| { + public open [ResolvedTo(BODY_RESOLVE)] fun implicitType(): R|kotlin/Int| { + ^implicitType Int(42) + } + + } diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.kt b/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.kt new file mode 100644 index 00000000000..724245109a2 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.kt @@ -0,0 +1,11 @@ +// SKIP_WHEN_OUT_OF_CONTENT_ROOT +// MODULE: m1 +// FILE: Interface.kt +interface Interface { + fun implicitType() = 42 +} + +// MODULE: m2(m1) +// MEMBER_NAME_FILTER: implicitType +// FILE: usage.kt +class Aaa(i: Interface) : Interface by i diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.txt b/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.txt new file mode 100644 index 00000000000..bf31086f855 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.txt @@ -0,0 +1,193 @@ +RAW_FIR: +TARGET: public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 + + } + +EXPECT_ACTUAL_MATCHING: +TARGET: public open [ResolvedTo(EXPECT_ACTUAL_MATCHING)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 + + } + +ARGUMENTS_OF_ANNOTATIONS: +TARGET: public open [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 + + } + +CONTRACTS: +TARGET: public open [ResolvedTo(CONTRACTS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0, FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /Interface.implicitType)] fun implicitType(): + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +TARGET: public open [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): R|kotlin/Int| + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +TARGET: public open [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): R|kotlin/Int| + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 + + } + +BODY_RESOLVE: +TARGET: public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /Interface.implicitType, containingClass=Aaa, delegateField=FirFieldSymbol /Aaa.$$delegate_0] fun implicitType(): R|kotlin/Int| + +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + 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 + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(IMPORTS)] usage.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public final [ResolvedTo(BODY_RESOLVE)] [DelegateFieldsMapKey={0=FirFieldSymbol /Aaa.$$delegate_0}] class Aaa : R|Interface| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Aaa] constructor([ResolvedTo(BODY_RESOLVE)] i: R|Interface|): R|Aaa| { + super() + } + + private final [ResolvedTo(BODY_RESOLVE)] field $$delegate_0: R|Interface| = R|/i| + + } diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.kt b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.kt new file mode 100644 index 00000000000..8f327a36e60 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.kt @@ -0,0 +1,6 @@ +// MEMBER_NAME_FILTER: property +abstract class SubClass: AbstractClass() + +abstract class AbstractClass { + abstract val property: T +} diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.txt b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.txt new file mode 100644 index 00000000000..d1e880d08ea --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.txt @@ -0,0 +1,304 @@ +RAW_FIR: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +IMPORTS: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +COMPILER_REQUIRED_ANNOTATIONS: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +COMPANION_GENERATION: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +SUPER_TYPES: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +TYPES: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +STATUS: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +EXPECT_ACTUAL_MATCHING: +TARGET: public abstract [ResolvedTo(EXPECT_ACTUAL_MATCHING)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +ARGUMENTS_OF_ANNOTATIONS: +TARGET: public abstract [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +CONTRACTS: +TARGET: public abstract [ResolvedTo(CONTRACTS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +TARGET: public abstract [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +TARGET: public abstract [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +BODY_RESOLVE: +TARGET: public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public abstract [ResolvedTo(STATUS)] val property: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): R|T| + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverride.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(BODY_RESOLVE)] class SubClass : R|AbstractClass| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + super|>() + } + + } + public abstract [ResolvedTo(BODY_RESOLVE)] class AbstractClass<[ResolvedTo(BODY_RESOLVE)] T> : R|kotlin/Any| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(BODY_RESOLVE)] T>(): R|AbstractClass| { + super() + } + + public abstract [ResolvedTo(BODY_RESOLVE)] val property: R|T| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=AbstractClass] get(): R|T| + + } diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.kt b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.kt new file mode 100644 index 00000000000..583f8989647 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.kt @@ -0,0 +1,11 @@ +// SKIP_WHEN_OUT_OF_CONTENT_ROOT +// MODULE: m1 +// FILE: AbstractClass.kt +abstract class AbstractClass { + abstract val property: T +} + +// MODULE: m2(m1) +// MEMBER_NAME_FILTER: property +// FILE: SubClass.kt +abstract class SubClass: AbstractClass() diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.txt b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.txt new file mode 100644 index 00000000000..374ab98ab62 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.txt @@ -0,0 +1,178 @@ +RAW_FIR: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +IMPORTS: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +COMPILER_REQUIRED_ANNOTATIONS: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +COMPANION_GENERATION: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +SUPER_TYPES: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +TYPES: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +STATUS: +TARGET: public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +EXPECT_ACTUAL_MATCHING: +TARGET: public abstract [ResolvedTo(EXPECT_ACTUAL_MATCHING)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +ARGUMENTS_OF_ANNOTATIONS: +TARGET: public abstract [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +CONTRACTS: +TARGET: public abstract [ResolvedTo(CONTRACTS)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +TARGET: public abstract [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +TARGET: public abstract [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +BODY_RESOLVE: +TARGET: public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(IMPORTS)] SubClass.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(BODY_RESOLVE)] class SubClass : R|AbstractClass| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + super|>() + } + + } diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.kt b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.kt new file mode 100644 index 00000000000..92f6adb822a --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.kt @@ -0,0 +1,7 @@ +// MEMBER_NAME_FILTER: property +abstract class SubClass: AbstractClass() + +abstract class AbstractClass { + val property = foo() + abstract fun foo(): T +} diff --git a/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.txt b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.txt new file mode 100644 index 00000000000..65088120c0a --- /dev/null +++ b/analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.txt @@ -0,0 +1,332 @@ +RAW_FIR: +TARGET: public final [ResolvedTo(STATUS)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +IMPORTS: +TARGET: public final [ResolvedTo(STATUS)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +COMPILER_REQUIRED_ANNOTATIONS: +TARGET: public final [ResolvedTo(STATUS)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +COMPANION_GENERATION: +TARGET: public final [ResolvedTo(STATUS)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +SUPER_TYPES: +TARGET: public final [ResolvedTo(STATUS)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +TYPES: +TARGET: public final [ResolvedTo(STATUS)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +STATUS: +TARGET: public final [ResolvedTo(STATUS)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +EXPECT_ACTUAL_MATCHING: +TARGET: public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +ARGUMENTS_OF_ANNOTATIONS: +TARGET: public final [ResolvedTo(ARGUMENTS_OF_ANNOTATIONS)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +CONTRACTS: +TARGET: public final [ResolvedTo(CONTRACTS)] [FakeOverrideSubstitutionKey=FakeOverrideSubstitution(substitutor={T -> kotlin/Int}, baseSymbol=FirPropertySymbol /AbstractClass.property), SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] get(): + + public abstract [ResolvedTo(STATUS)] fun foo(): R|T| + + } + +IMPLICIT_TYPES_BODY_RESOLVE: +TARGET: public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val property: R|T| = this@R|/AbstractClass|.R|/AbstractClass.foo|() + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [ContainingClassKey=AbstractClass] get(): R|T| + + public abstract [ResolvedTo(CONTRACTS)] fun foo(): R|T| + + } + +ANNOTATIONS_ARGUMENTS_MAPPING: +TARGET: public final [ResolvedTo(ANNOTATIONS_ARGUMENTS_MAPPING)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val property: R|T| = this@R|/AbstractClass|.R|/AbstractClass.foo|() + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [ContainingClassKey=AbstractClass] get(): R|T| + + public abstract [ResolvedTo(CONTRACTS)] fun foo(): R|T| + + } + +BODY_RESOLVE: +TARGET: public final [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/AbstractClass.property] val property: R|kotlin/Int| + + +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(STATUS)] class SubClass : R|AbstractClass| { + public [ResolvedTo(STATUS)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + LAZY_super|> + } + + } + public abstract [ResolvedTo(STATUS)] class AbstractClass<[ResolvedTo(STATUS)] T> : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(STATUS)] T>(): R|AbstractClass| { + LAZY_super + } + + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val property: R|T| = this@R|/AbstractClass|.R|/AbstractClass.foo|() + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [ContainingClassKey=AbstractClass] get(): R|T| + + public abstract [ResolvedTo(CONTRACTS)] fun foo(): R|T| + + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(IMPORTS)] substitutionFakeOverrideWithImplicitType.kt + [ResolvedTo(BODY_RESOLVE)] annotations container + public abstract [ResolvedTo(BODY_RESOLVE)] class SubClass : R|AbstractClass| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=SubClass] constructor(): R|SubClass| { + super|>() + } + + } + public abstract [ResolvedTo(BODY_RESOLVE)] class AbstractClass<[ResolvedTo(BODY_RESOLVE)] T> : R|kotlin/Any| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=AbstractClass] constructor<[ResolvedTo(BODY_RESOLVE)] T>(): R|AbstractClass| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] val property: R|T| = this@R|/AbstractClass|.R|/AbstractClass.foo|() + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=AbstractClass] get(): R|T| + + public abstract [ResolvedTo(BODY_RESOLVE)] fun foo(): R|T| + + } diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractFirLazyDeclarationResolveTest.kt b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractFirLazyDeclarationResolveTest.kt index fcd92918bdd..0df932b9147 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractFirLazyDeclarationResolveTest.kt +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractFirLazyDeclarationResolveTest.kt @@ -36,7 +36,7 @@ abstract class AbstractFirLazyDeclarationResolveTest : AbstractFirLazyDeclaratio if (Directives.RESOLVE_FILE_ANNOTATIONS in moduleStructure.allDirectives) { val annotationContainer = firResolveSession.getOrBuildFirFile(ktFile).annotationsContainer val session = annotationContainer.moduleData.session as LLFirResolvableModuleSession - fun(phase: FirResolvePhase) { + annotationContainer to fun(phase: FirResolvePhase) { session.moduleComponents.firModuleLazyDeclarationResolver.lazyResolve( annotationContainer, session.getScopeSession(), @@ -46,8 +46,8 @@ abstract class AbstractFirLazyDeclarationResolveTest : AbstractFirLazyDeclaratio } else { val ktDeclaration = testServices.expressionMarkerProvider.getElementOfTypeAtCaret(ktFile) val declarationSymbol = ktDeclaration.resolveToFirSymbol(firResolveSession) - val firDeclaration = chooseMemberDeclarationIfNeeded(declarationSymbol, moduleStructure) - fun(phase: FirResolvePhase) { + val firDeclaration = chooseMemberDeclarationIfNeeded(declarationSymbol, moduleStructure, firResolveSession) + firDeclaration.fir to fun(phase: FirResolvePhase) { firDeclaration.lazyResolveToPhase(phase) } } diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractFirLazyDeclarationResolveTestCase.kt b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractFirLazyDeclarationResolveTestCase.kt index fc2c781d22c..e06973f743d 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractFirLazyDeclarationResolveTestCase.kt +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractFirLazyDeclarationResolveTestCase.kt @@ -6,7 +6,10 @@ package org.jetbrains.kotlin.analysis.low.level.api.fir import org.jetbrains.kotlin.analysis.low.level.api.fir.api.LLFirResolveSession +import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.LLFirResolveMultiDesignationCollector import org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.AbstractLowLevelApiSingleFileTest +import org.jetbrains.kotlin.analysis.low.level.api.fir.util.FirElementFinder.findElementIn +import org.jetbrains.kotlin.fir.FirElementWithResolveState import org.jetbrains.kotlin.fir.declarations.FirFile import org.jetbrains.kotlin.fir.declarations.FirResolvePhase import org.jetbrains.kotlin.fir.renderer.FirDeclarationRendererWithFilteredAttributes @@ -14,6 +17,7 @@ import org.jetbrains.kotlin.fir.renderer.FirErrorExpressionExtendedRenderer import org.jetbrains.kotlin.fir.renderer.FirFileAnnotationsContainerRenderer import org.jetbrains.kotlin.fir.renderer.FirRenderer import org.jetbrains.kotlin.fir.renderer.FirResolvePhaseRenderer +import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase @@ -35,7 +39,7 @@ abstract class AbstractFirLazyDeclarationResolveTestCase : AbstractLowLevelApiSi protected fun doLazyResolveTest( ktFile: KtFile, testServices: TestServices, - resolverProvider: (LLFirResolveSession) -> ((FirResolvePhase) -> Unit), + resolverProvider: (LLFirResolveSession) -> Pair Unit)>, ) { val resultBuilder = StringBuilder() val renderer = FirRenderer( @@ -48,18 +52,35 @@ abstract class AbstractFirLazyDeclarationResolveTestCase : AbstractLowLevelApiSi resolveWithClearCaches(ktFile) { firResolveSession -> checkSession(firResolveSession) - val resolver = resolverProvider(firResolveSession) + + val firFile = firResolveSession.getOrBuildFirFile(ktFile) + val (elementToResolve, resolver) = resolverProvider(firResolveSession) + val designations = LLFirResolveMultiDesignationCollector.getDesignationsToResolve(elementToResolve) + val filesToRender = listOf(firFile).plus(designations.map { it.firFile }).distinct() + val shouldRenderDeclaration = filesToRender.all { file -> + findElementIn(file) { + it == elementToResolve + } == null + } + for (currentPhase in FirResolvePhase.entries) { if (currentPhase == FirResolvePhase.SEALED_CLASS_INHERITORS) continue resolver(currentPhase) - val firFile = firResolveSession.getOrBuildFirFile(ktFile) if (resultBuilder.isNotEmpty()) { resultBuilder.appendLine() } - resultBuilder.append("${currentPhase.name}:\n") - renderer.renderElementAsString(firFile) + resultBuilder.append("${currentPhase.name}:") + if (shouldRenderDeclaration) { + resultBuilder.append("\nTARGET: ") + renderer.renderElementAsString(elementToResolve) + } + + for (file in filesToRender) { + resultBuilder.appendLine() + renderer.renderElementAsString(file) + } } } @@ -78,7 +99,11 @@ abstract class AbstractFirLazyDeclarationResolveTestCase : AbstractLowLevelApiSi testServices.assertions.assertEqualsToTestDataFileSibling(resultBuilder.toString()) } - protected fun chooseMemberDeclarationIfNeeded(symbol: FirBasedSymbol<*>, moduleStructure: TestModuleStructure): FirBasedSymbol<*> { + protected fun chooseMemberDeclarationIfNeeded( + symbol: FirBasedSymbol<*>, + moduleStructure: TestModuleStructure, + session: LLFirResolveSession, + ): FirBasedSymbol<*> { val directives = moduleStructure.allDirectives val memberClassFilters = listOfNotNull( directives.singleOrZeroValue(Directives.MEMBER_CLASS_FILTER), @@ -87,14 +112,46 @@ abstract class AbstractFirLazyDeclarationResolveTestCase : AbstractLowLevelApiSi val classSymbol = symbol as FirClassSymbol val declarations = classSymbol.declarationSymbols - val filteredSymbols = declarations.filter { declaration -> memberClassFilters.all { it.invoke(declaration) } } + val filter = { declaration: FirBasedSymbol<*> -> memberClassFilters.all { it.invoke(declaration) } } + val filteredSymbols = declarations.filter(filter) return when (filteredSymbols.size) { - 0 -> error("Empty result for:${declarations.joinToString("\n")}") + 0 -> deepSearch(classSymbol, session, filter) ?: error("Empty result for:${declarations.joinToString("\n")}") 1 -> filteredSymbols.single() else -> error("Result ambiguity:\n${filteredSymbols.joinToString("\n")}") } } + private fun deepSearch( + classSymbol: FirClassSymbol<*>, + session: LLFirResolveSession, + filter: (FirBasedSymbol<*>) -> Boolean, + ): FirBasedSymbol<*>? { + val scope = classSymbol.unsubstitutedScope( + session.useSiteFirSession, + session.getScopeSessionFor(session.useSiteFirSession), + false, + FirResolvePhase.STATUS, + ) + + val names = scope.getCallableNames() + val declarations = mutableListOf>() + for (name in names) { + scope.processFunctionsByName(name) { + if (filter(it)) { + declarations += it + } + } + + scope.processPropertiesByName(name) { + if (filter(it)) { + declarations += it + } + } + } + + return declarations.singleOrNull() ?: error("Can't choose from:\n${declarations.joinToString("\n")}") + } + override fun configureTest(builder: TestConfigurationBuilder) { super.configureTest(builder) with(builder) { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractStdLibSourcesLazyDeclarationResolveTest.kt b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractStdLibSourcesLazyDeclarationResolveTest.kt index 5d33548daeb..0c5c6e0f2d6 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractStdLibSourcesLazyDeclarationResolveTest.kt +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractStdLibSourcesLazyDeclarationResolveTest.kt @@ -47,8 +47,8 @@ abstract class AbstractStdLibSourcesLazyDeclarationResolveTest : AbstractFirLazy doLazyResolveTest(file, testServices) { firSession -> val regularClass = findRegularClass(classId, module, firSession) - val declarationToResolve = chooseMemberDeclarationIfNeeded(regularClass, moduleStructure) - fun(phase: FirResolvePhase) { + val declarationToResolve = chooseMemberDeclarationIfNeeded(regularClass, moduleStructure, firSession) + declarationToResolve.fir to fun(phase: FirResolvePhase) { declarationToResolve.lazyResolveToPhase(phase) } } diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java index c9f3e1b70d1..3d5627ad334 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyDeclarationResolveTestGenerated.java @@ -162,6 +162,18 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testdata/lazyResolve/dataComponent2.kt"); } + @Test + @TestMetadata("delegateWithImplicitType.kt") + public void testDelegateWithImplicitType() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.kt"); + } + + @Test + @TestMetadata("delegateWithImplicitTypeInDifferentModules.kt") + public void testDelegateWithImplicitTypeInDifferentModules() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.kt"); + } + @Test @TestMetadata("delegatedField.kt") public void testDelegatedField() throws Exception { @@ -402,6 +414,24 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testdata/lazyResolve/secondaryConstructorParameter.kt"); } + @Test + @TestMetadata("substitutionFakeOverride.kt") + public void testSubstitutionFakeOverride() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.kt"); + } + + @Test + @TestMetadata("substitutionFakeOverrideInDifferentModules.kt") + public void testSubstitutionFakeOverrideInDifferentModules() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.kt"); + } + + @Test + @TestMetadata("substitutionFakeOverrideWithImplicitType.kt") + public void testSubstitutionFakeOverrideWithImplicitType() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.kt"); + } + @Test @TestMetadata("superTypes.kt") public void testSuperTypes() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java index 3a88e5f20f9..b527f926dfb 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyDeclarationResolveTestGenerated.java @@ -162,6 +162,18 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testdata/lazyResolve/dataComponent2.kt"); } + @Test + @TestMetadata("delegateWithImplicitType.kt") + public void testDelegateWithImplicitType() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitType.kt"); + } + + @Test + @TestMetadata("delegateWithImplicitTypeInDifferentModules.kt") + public void testDelegateWithImplicitTypeInDifferentModules() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/delegateWithImplicitTypeInDifferentModules.kt"); + } + @Test @TestMetadata("delegatedField.kt") public void testDelegatedField() throws Exception { @@ -402,6 +414,24 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testdata/lazyResolve/secondaryConstructorParameter.kt"); } + @Test + @TestMetadata("substitutionFakeOverride.kt") + public void testSubstitutionFakeOverride() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverride.kt"); + } + + @Test + @TestMetadata("substitutionFakeOverrideInDifferentModules.kt") + public void testSubstitutionFakeOverrideInDifferentModules() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideInDifferentModules.kt"); + } + + @Test + @TestMetadata("substitutionFakeOverrideWithImplicitType.kt") + public void testSubstitutionFakeOverrideWithImplicitType() throws Exception { + runTest("analysis/low-level-api-fir/testdata/lazyResolve/substitutionFakeOverrideWithImplicitType.kt"); + } + @Test @TestMetadata("superTypes.kt") public void testSuperTypes() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/test/base/AbstractLowLevelApiSingleFileTest.kt b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/test/base/AbstractLowLevelApiSingleFileTest.kt index 1acf51416b6..bb491fc38cc 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/test/base/AbstractLowLevelApiSingleFileTest.kt +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/test/base/AbstractLowLevelApiSingleFileTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -13,7 +13,7 @@ import org.jetbrains.kotlin.test.services.TestServices abstract class AbstractLowLevelApiSingleFileTest : AbstractAnalysisApiBasedTest() { final override fun doTestByModuleStructure(moduleStructure: TestModuleStructure, testServices: TestServices) { - val singleModule = moduleStructure.modules.single() + val singleModule = moduleStructure.modules.last() val singleFile = testServices.ktModuleProvider.getModuleFiles(singleModule).filterIsInstance().first() doTestByFileStructure(singleFile, moduleStructure, testServices) } diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/resolve/substitution/ConeSubstitutor.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/resolve/substitution/ConeSubstitutor.kt index c4ea15d8b80..8d17f6372f8 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/resolve/substitution/ConeSubstitutor.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/resolve/substitution/ConeSubstitutor.kt @@ -21,6 +21,7 @@ abstract class ConeSubstitutor : TypeSubstitutorMarker { return null } + override fun toString(): String = "Empty" } } diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/ClassMembers.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/ClassMembers.kt index 09bd5a1de65..8f3bb3fb542 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/ClassMembers.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/ClassMembers.kt @@ -207,7 +207,11 @@ class DelegatedWrapperData( val wrapped: D, val containingClass: ConeClassLikeLookupTag, val delegateField: FirField, -) +) { + override fun toString(): String = "[${::wrapped.name}=${wrapped.symbol}, " + + "${::containingClass.name}=$containingClass, " + + "${::delegateField.name}=${delegateField.symbol}" +} var D.delegatedWrapperData: DelegatedWrapperData? by FirDeclarationDataRegistry.data(DelegatedWrapperDataKey)