From a25bac4bf9028154ac78a84773250bc90f503b1c Mon Sep 17 00:00:00 2001 From: Dmitrii Gridin Date: Tue, 31 Oct 2023 14:26:44 +0100 Subject: [PATCH] add tests on implicit type with inaccessible annotations ^KT-63042 --- ...ctionWithInaccessibleAnnotationArgument.kt | 15 + ...tionWithInaccessibleAnnotationArgument.txt | 254 ++++++++++++ ...pertyWithInaccessibleAnnotationArgument.kt | 18 + ...ertyWithInaccessibleAnnotationArgument.txt | 319 +++++++++++++++ .../implicitTypeWithInaccessibleAnnotation.kt | 14 + ...implicitTypeWithInaccessibleAnnotation.txt | 370 ++++++++++++++++++ .../impliciyTypeWithAnnotationOnFunction.kt | 8 + .../impliciyTypeWithAnnotationOnFunction.txt | 223 +++++++++++ .../impliciyTypeWithAnnotationOnProperty.kt | 10 + .../impliciyTypeWithAnnotationOnProperty.txt | 256 ++++++++++++ .../typeAliasWithAnnotationOnType.kt | 4 + .../typeAliasWithAnnotationOnType.txt | 168 ++++++++ ...otLazyDeclarationResolveTestGenerated.java | 36 ++ ...ceLazyDeclarationResolveTestGenerated.java | 36 ++ ...CompilerTestFE10TestdataTestGenerated.java | 6 + ...sticCompilerFE10TestDataTestGenerated.java | 6 + ...eeOldFrontendDiagnosticsTestGenerated.java | 6 + ...siOldFrontendDiagnosticsTestGenerated.java | 6 + ...licitTypeWithInaccessibleAnnotation.fir.kt | 14 + .../implicitTypeWithInaccessibleAnnotation.kt | 14 + ...TypeWithInaccessibleAnnotation.reversed.kt | 14 + .../test/runners/DiagnosticTestGenerated.java | 6 + 22 files changed, 1803 insertions(+) create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.kt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.txt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.kt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.txt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.kt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.txt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.kt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.txt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.kt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.txt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.kt create mode 100644 analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.txt create mode 100644 compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.reversed.kt diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.kt b/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.kt new file mode 100644 index 00000000000..ef266a8145e --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.kt @@ -0,0 +1,15 @@ +// SKIP_WHEN_OUT_OF_CONTENT_ROOT +// MODULE: m1 +// FILE: declaration.kt +@Target(AnnotationTarget.TYPE) +annotation class Anno(val number: Int) +private const val privateConstant = 0 +internal const val internalConstant = 1 + +fun withType(): @Anno(internalConstant) List<@Anno(privateConstant) Int> { + +} + +// MODULE: m2(m1) +// FILE: usafe.kt +fun implicitType() = withType() \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.txt b/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.txt new file mode 100644 index 00000000000..cae7ed49215 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.txt @@ -0,0 +1,254 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun withType(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int> { LAZY_BLOCK } + +FILE: [ResolvedTo(RAW_FIR)] usafe.kt + public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun withType(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int> { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(RAW_FIR)] fun implicitType(): { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun withType(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int> { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun implicitType(): { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun withType(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int> { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(COMPANION_GENERATION)] fun implicitType(): { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun withType(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int> { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(SUPER_TYPES)] fun implicitType(): { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun withType(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int> { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(TYPES)] fun implicitType(): { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun withType(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int> { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(STATUS)] fun implicitType(): { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun withType(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int> { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun implicitType(): { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun withType(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int> { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(CONTRACTS)] fun implicitType(): { LAZY_BLOCK } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] declaration.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(CONTRACTS)] fun withType(): R|@R|Anno|(internalConstant#) kotlin/collections/List<@R|Anno|(privateConstant#) kotlin/Int>| { + } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitType(): R|@R|Anno|(internalConstant#) kotlin/collections/List<@R|Anno|(privateConstant#) kotlin/Int>| { + ^implicitType R|/withType|() + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] declaration.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + private final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val privateConstant: R|kotlin/Int| = Int(0) + private [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + internal final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val internalConstant: R|kotlin/Int| = Int(1) + internal [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + public final [ResolvedTo(CONTRACTS)] fun withType(): R|@R|Anno|(number = R|/internalConstant#|) kotlin/collections/List<@R|Anno|(number = R|/privateConstant#|) kotlin/Int>| { + } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun implicitType(): R|@R|Anno|(number = R|/internalConstant#|) kotlin/collections/List<@R|Anno|(number = R|/privateConstant#|) kotlin/Int>| { + ^implicitType R|/withType|() + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] declaration.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + private final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val privateConstant: R|kotlin/Int| = Int(0) + private [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + internal final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val internalConstant: R|kotlin/Int| = Int(1) + internal [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + public final [ResolvedTo(CONTRACTS)] fun withType(): R|@R|Anno|(number = R|/internalConstant#|) kotlin/collections/List<@R|Anno|(number = R|/privateConstant#|) kotlin/Int>| { + } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(BODY_RESOLVE)] fun implicitType(): R|@R|Anno|(number = R|/internalConstant#|) kotlin/collections/List<@R|Anno|(number = R|/privateConstant#|) kotlin/Int>| { + ^implicitType R|/withType|() + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] usafe.kt + public final [ResolvedTo(BODY_RESOLVE)] fun implicitType(): R|@R|Anno|(number = R|/internalConstant#|) kotlin/collections/List<@R|Anno|(number = R|/privateConstant#|) kotlin/Int>| { + ^implicitType R|/withType|() + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.kt b/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.kt new file mode 100644 index 00000000000..d327aa6d362 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.kt @@ -0,0 +1,18 @@ +// SKIP_WHEN_OUT_OF_CONTENT_ROOT +// MODULE: m1 +// FILE: declaration.kt +private const val privateConstant = "0" +internal const val internalConstant = "1" +const val regularConstant = "2" + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val message: String) + +val nullablePropertyWithAnnotatedType: @Anno(privateConstant) List<@Anno(internalConstant) List<@Anno(regularConstant) Int>>? + get() = null + +// MODULE: m2(m1) +// FILE: usafe.kt + +val propertyToResolve: String + get() = nullablePropertyWithAnnotatedType?.let { " ($it)" } ?: "" \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.txt b/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.txt new file mode 100644 index 00000000000..3ea2af3292b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.txt @@ -0,0 +1,319 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(RAW_FIR)] usafe.kt + public? final? [ResolvedTo(RAW_FIR)] val propertyToResolve: String + public? [ResolvedTo(RAW_FIR)] get(): String { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(RAW_FIR)] val propertyToResolve: String + public? [ResolvedTo(RAW_FIR)] get(): String { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] val propertyToResolve: String + public? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] get(): String { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(COMPANION_GENERATION)] val propertyToResolve: String + public? [ResolvedTo(COMPANION_GENERATION)] get(): String { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(SUPER_TYPES)] val propertyToResolve: String + public? [ResolvedTo(SUPER_TYPES)] get(): String { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public? final? [ResolvedTo(TYPES)] val propertyToResolve: R|kotlin/String| + public? [ResolvedTo(TYPES)] get(): R|kotlin/String| { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(STATUS)] val propertyToResolve: R|kotlin/String| + public [ResolvedTo(STATUS)] get(): R|kotlin/String| { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] val propertyToResolve: R|kotlin/String| + public [ResolvedTo(EXPECT_ACTUAL_MATCHING)] get(): R|kotlin/String| { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(CONTRACTS)] val propertyToResolve: R|kotlin/String| + public [ResolvedTo(CONTRACTS)] get(): R|kotlin/String| { + ^ nullablePropertyWithAnnotatedType#?.{ $subj$.let#( = [ResolvedTo(RAW_FIR)] let@fun .(): { + (String( (), it#, String())) + } + ) } ?: String() + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val propertyToResolve: R|kotlin/String| + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| { + ^ nullablePropertyWithAnnotatedType#?.{ $subj$.let#( = [ResolvedTo(RAW_FIR)] let@fun .(): { + (String( (), it#, String())) + } + ) } ?: String() + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(RAW_FIR)] declaration.kt + private final? const [ResolvedTo(RAW_FIR)] val privateConstant: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] get(): + internal final? const [ResolvedTo(RAW_FIR)] val internalConstant: = LAZY_EXPRESSION + internal [ResolvedTo(RAW_FIR)] get(): + public? final? const [ResolvedTo(RAW_FIR)] val regularConstant: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.message] message: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val message: String = R|/message| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] val nullablePropertyWithAnnotatedType: @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? + public? [ResolvedTo(RAW_FIR)] get(): @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Int>>? { LAZY_BLOCK } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] val propertyToResolve: R|kotlin/String| + public [ResolvedTo(ANNOTATION_ARGUMENTS)] get(): R|kotlin/String| { + ^ nullablePropertyWithAnnotatedType#?.{ $subj$.let#( = [ResolvedTo(RAW_FIR)] let@fun .(): { + (String( (), it#, String())) + } + ) } ?: String() + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] declaration.kt + private final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val privateConstant: R|kotlin/String| = String(0) + private [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + internal final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val internalConstant: R|kotlin/String| = String(1) + internal [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val regularConstant: R|kotlin/String| = String(2) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.message] message: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val message: R|kotlin/String| = R|/message| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final [ResolvedTo(CONTRACTS)] val nullablePropertyWithAnnotatedType: R|@R|Anno|(R|/privateConstant#|) kotlin/collections/List<@R|Anno|(R|/internalConstant#|) kotlin/collections/List<@R|Anno|(R|/regularConstant|) kotlin/Int>>?| + public [ResolvedTo(CONTRACTS)] get(): R|@R|Anno|(R|/privateConstant#|) kotlin/collections/List<@R|Anno|(R|/internalConstant#|) kotlin/collections/List<@R|Anno|(R|/regularConstant|) kotlin/Int>>?| { + ^ Null(null) + } + +FILE: [ResolvedTo(IMPORTS)] usafe.kt + public final [ResolvedTo(BODY_RESOLVE)] val propertyToResolve: R|kotlin/String| + public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String| { + ^ R|/nullablePropertyWithAnnotatedType|?.{ $subj$.R|kotlin/let|#|) kotlin/collections/List<@R|Anno|(message = R|/internalConstant#|) kotlin/collections/List<@R|Anno|(message = R|/regularConstant|) kotlin/Int>>|, R|kotlin/String|>( = [ResolvedTo(BODY_RESOLVE)] [MatchingParameterFunctionTypeKey=kotlin/Function1] let@fun ([ResolvedTo(BODY_RESOLVE)] it: R|@R|Anno|(message = R|/privateConstant#|) kotlin/collections/List<@R|Anno|(message = R|/internalConstant#|) kotlin/collections/List<@R|Anno|(message = R|/regularConstant|) kotlin/Int>>|): R|kotlin/String| { + ^ (String( (), R|/it|, String())) + } + ) } ?: String() + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] usafe.kt + public final [ResolvedTo(BODY_RESOLVE)] val propertyToResolve: R|kotlin/String| + public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String| { + ^ R|/nullablePropertyWithAnnotatedType|?.{ $subj$.R|kotlin/let|#|) kotlin/collections/List<@R|Anno|(message = R|/internalConstant#|) kotlin/collections/List<@R|Anno|(message = R|/regularConstant|) kotlin/Int>>|, R|kotlin/String|>( = [ResolvedTo(BODY_RESOLVE)] [MatchingParameterFunctionTypeKey=kotlin/Function1] let@fun ([ResolvedTo(BODY_RESOLVE)] it: R|@R|Anno|(message = R|/privateConstant#|) kotlin/collections/List<@R|Anno|(message = R|/internalConstant#|) kotlin/collections/List<@R|Anno|(message = R|/regularConstant|) kotlin/Int>>|): R|kotlin/String| { + ^ (String( (), R|/it|, String())) + } + ) } ?: String() + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.kt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.kt new file mode 100644 index 00000000000..ab919a58564 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.kt @@ -0,0 +1,14 @@ +package usage + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val s: String) + +fun implicitType1() = TopLevelObject.expectedType() + +object TopLevelObject { + fun expectedType2(): @Anno(privateConstVal) Int = 4 + private const val privateConstVal = "privateConstVal" + fun expectedType(): @Anno(privateConstVal) Int = 4 +} + +fun implicitType2() = TopLevelObject.expectedType2() \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.txt b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.txt new file mode 100644 index 00000000000..46142ff5b00 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.txt @@ -0,0 +1,370 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] implicitTypeWithInaccessibleAnnotation.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType1(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType2(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + private final? const [ResolvedTo(RAW_FIR)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] get(): + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType1(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType2(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + private final? const [ResolvedTo(RAW_FIR)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] get(): + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun implicitType1(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType2(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + private final? const [ResolvedTo(RAW_FIR)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] get(): + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(COMPANION_GENERATION)] fun implicitType1(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType2(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + private final? const [ResolvedTo(RAW_FIR)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] get(): + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(SUPER_TYPES)] fun implicitType1(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType2(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + private final? const [ResolvedTo(RAW_FIR)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] get(): + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? [ResolvedTo(TYPES)] fun implicitType1(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType2(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + private final? const [ResolvedTo(RAW_FIR)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] get(): + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public final [ResolvedTo(STATUS)] fun implicitType1(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType2(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + private final? const [ResolvedTo(RAW_FIR)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] get(): + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun implicitType1(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType2(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + private final? const [ResolvedTo(RAW_FIR)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] get(): + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public final [ResolvedTo(CONTRACTS)] fun implicitType1(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType2(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + private final? const [ResolvedTo(RAW_FIR)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(RAW_FIR)] [ContainingClassKey=TopLevelObject] get(): + + public? final? [ResolvedTo(RAW_FIR)] fun expectedType(): @Anno[Unresolved](LAZY_EXPRESSION) Int { LAZY_BLOCK } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=usage/Anno.s] s: String): R|usage/Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun implicitType1(): R|@R|usage/Anno|(privateConstVal#) kotlin/Int| { + ^implicitType1 Q|usage/TopLevelObject|.R|usage/TopLevelObject.expectedType|() + } + public final [ResolvedTo(STATUS)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(STATUS)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] fun expectedType2(): R|@R|usage/Anno|(privateConstVal#) kotlin/Int| { LAZY_BLOCK } + + private final const [ResolvedTo(STATUS)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(STATUS)] [ContainingClassKey=TopLevelObject] get(): + + public final [ResolvedTo(CONTRACTS)] fun expectedType(): R|@R|usage/Anno|(privateConstVal#) kotlin/Int| { + ^expectedType IntegerLiteral(4) + } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=usage/Anno.s] s: R|kotlin/String|): R|usage/Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|/s| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun implicitType1(): R|@R|usage/Anno|(s = #) kotlin/Int| { + ^implicitType1 Q|usage/TopLevelObject|.R|usage/TopLevelObject.expectedType|() + } + public final [ResolvedTo(STATUS)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(STATUS)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] fun expectedType2(): R|@R|usage/Anno|(privateConstVal#) kotlin/Int| { LAZY_BLOCK } + + private final const [ResolvedTo(STATUS)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(STATUS)] [ContainingClassKey=TopLevelObject] get(): + + public final [ResolvedTo(CONTRACTS)] fun expectedType(): R|@R|usage/Anno|(s = #) kotlin/Int| { + ^expectedType IntegerLiteral(4) + } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] implicitTypeWithInaccessibleAnnotation.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=usage/Anno.s] s: R|kotlin/String|): R|usage/Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|/s| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final [ResolvedTo(BODY_RESOLVE)] fun implicitType1(): R|@R|usage/Anno|(s = #) kotlin/Int| { + ^implicitType1 Q|usage/TopLevelObject|.R|usage/TopLevelObject.expectedType|() + } + public final [ResolvedTo(STATUS)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(STATUS)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] fun expectedType2(): R|@R|usage/Anno|(privateConstVal#) kotlin/Int| { LAZY_BLOCK } + + private final const [ResolvedTo(STATUS)] val privateConstVal: = LAZY_EXPRESSION + private [ResolvedTo(STATUS)] [ContainingClassKey=TopLevelObject] get(): + + public final [ResolvedTo(CONTRACTS)] fun expectedType(): R|@R|usage/Anno|(s = #) kotlin/Int| { + ^expectedType IntegerLiteral(4) + } + + } + public? final? [ResolvedTo(RAW_FIR)] fun implicitType2(): { LAZY_BLOCK } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] implicitTypeWithInaccessibleAnnotation.kt + @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=usage/Anno.s] s: R|kotlin/String|): R|usage/Anno| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val s: R|kotlin/String| = R|/s| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final [ResolvedTo(BODY_RESOLVE)] fun implicitType1(): R|@R|usage/Anno|(s = #) kotlin/Int| { + ^implicitType1 Q|usage/TopLevelObject|.R|usage/TopLevelObject.expectedType|() + } + public final [ResolvedTo(BODY_RESOLVE)] object TopLevelObject : R|kotlin/Any| { + private [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=TopLevelObject] constructor(): R|usage/TopLevelObject| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] fun expectedType2(): R|@R|usage/Anno|(s = this@R|usage/TopLevelObject|.R|usage/TopLevelObject.privateConstVal|) kotlin/Int| { + ^expectedType2 Int(4) + } + + private final const [ResolvedTo(BODY_RESOLVE)] val privateConstVal: R|kotlin/String| = String(privateConstVal) + private [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=TopLevelObject] get(): R|kotlin/String| + + public final [ResolvedTo(BODY_RESOLVE)] fun expectedType(): R|@R|usage/Anno|(s = #) kotlin/Int| { + ^expectedType Int(4) + } + + } + public final [ResolvedTo(BODY_RESOLVE)] fun implicitType2(): R|@R|usage/Anno|(s = this@R|usage/TopLevelObject|.R|usage/TopLevelObject.privateConstVal|) kotlin/Int| { + ^implicitType2 Q|usage/TopLevelObject|.R|usage/TopLevelObject.expectedType2|() + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.kt b/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.kt new file mode 100644 index 00000000000..fba33e9c321 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.kt @@ -0,0 +1,8 @@ +@Target(AnnotationTarget.TYPE) +annotation class Anno(val number: Int) + +const val value = 0 + +fun typeWithAnnotation(): @Anno(value) String = "" + +fun resolveMe() = typeWithAnnotation() \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.txt b/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.txt new file mode 100644 index 00000000000..9038dbe2d88 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.txt @@ -0,0 +1,223 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] impliciyTypeWithAnnotationOnFunction.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun resolveMe(): { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun resolveMe(): { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun resolveMe(): { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(COMPANION_GENERATION)] fun resolveMe(): { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(SUPER_TYPES)] fun resolveMe(): { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(TYPES)] fun resolveMe(): { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public final [ResolvedTo(STATUS)] fun resolveMe(): { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun resolveMe(): { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public final [ResolvedTo(CONTRACTS)] fun resolveMe(): { LAZY_BLOCK } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(CONTRACTS)] fun typeWithAnnotation(): R|@R|Anno|(value#) kotlin/String| { + ^typeWithAnnotation String() + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun resolveMe(): R|@R|Anno|(value#) kotlin/String| { + ^resolveMe R|/typeWithAnnotation|() + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val value: R|kotlin/Int| = Int(0) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + public final [ResolvedTo(CONTRACTS)] fun typeWithAnnotation(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^typeWithAnnotation String() + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun resolveMe(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^resolveMe R|/typeWithAnnotation|() + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnFunction.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val value: R|kotlin/Int| = Int(0) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + public final [ResolvedTo(CONTRACTS)] fun typeWithAnnotation(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^typeWithAnnotation String() + } + public final [ResolvedTo(BODY_RESOLVE)] fun resolveMe(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^resolveMe R|/typeWithAnnotation|() + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] impliciyTypeWithAnnotationOnFunction.kt + @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + public final const [ResolvedTo(BODY_RESOLVE)] val value: R|kotlin/Int| = Int(0) + public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int| + public final [ResolvedTo(BODY_RESOLVE)] fun typeWithAnnotation(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^typeWithAnnotation String() + } + public final [ResolvedTo(BODY_RESOLVE)] fun resolveMe(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^resolveMe R|/typeWithAnnotation|() + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.kt b/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.kt new file mode 100644 index 00000000000..6d4599b63f0 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.kt @@ -0,0 +1,10 @@ +@Target(AnnotationTarget.TYPE) +annotation class Anno(val number: Int) + +const val value = 0 + +fun typeWithAnnotation(): @Anno(value) String = "" + +var resolveMe + get() = typeWithAnnotation() + set(value) {} \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.txt b/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.txt new file mode 100644 index 00000000000..11351d89cd2 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.txt @@ -0,0 +1,256 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] impliciyTypeWithAnnotationOnProperty.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] var resolveMe: + public? [ResolvedTo(RAW_FIR)] get(): { LAZY_BLOCK } + public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] value: ): R|kotlin/Unit| { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] var resolveMe: + public? [ResolvedTo(RAW_FIR)] get(): { LAZY_BLOCK } + public? [ResolvedTo(RAW_FIR)] set([ResolvedTo(RAW_FIR)] value: ): R|kotlin/Unit| { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] var resolveMe: + public? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] get(): { LAZY_BLOCK } + public? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] set([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] value: ): R|kotlin/Unit| { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(COMPANION_GENERATION)] var resolveMe: + public? [ResolvedTo(COMPANION_GENERATION)] get(): { LAZY_BLOCK } + public? [ResolvedTo(COMPANION_GENERATION)] set([ResolvedTo(COMPANION_GENERATION)] value: ): R|kotlin/Unit| { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(SUPER_TYPES)] var resolveMe: + public? [ResolvedTo(SUPER_TYPES)] get(): { LAZY_BLOCK } + public? [ResolvedTo(SUPER_TYPES)] set([ResolvedTo(SUPER_TYPES)] value: ): R|kotlin/Unit| { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public? final? [ResolvedTo(TYPES)] var resolveMe: + public? [ResolvedTo(TYPES)] get(): { LAZY_BLOCK } + public? [ResolvedTo(TYPES)] set([ResolvedTo(TYPES)] value: ): R|kotlin/Unit| { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public final [ResolvedTo(STATUS)] var resolveMe: + public [ResolvedTo(STATUS)] get(): { LAZY_BLOCK } + public [ResolvedTo(STATUS)] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] var resolveMe: + public [ResolvedTo(EXPECT_ACTUAL_MATCHING)] get(): { LAZY_BLOCK } + public [ResolvedTo(EXPECT_ACTUAL_MATCHING)] set([ResolvedTo(EXPECT_ACTUAL_MATCHING)] value: ): R|kotlin/Unit| { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun typeWithAnnotation(): @Anno[Unresolved](LAZY_EXPRESSION) String { LAZY_BLOCK } + public final [ResolvedTo(CONTRACTS)] var resolveMe: + public [ResolvedTo(CONTRACTS)] get(): { + ^ typeWithAnnotation#() + } + public [ResolvedTo(CONTRACTS)] set([ResolvedTo(CONTRACTS)] value: ): R|kotlin/Unit| { + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class Anno : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/Anno.number] number: Int): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val number: Int = R|/number| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): Int + + } + public? final? const [ResolvedTo(RAW_FIR)] val value: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(CONTRACTS)] fun typeWithAnnotation(): R|@R|Anno|(value#) kotlin/String| { + ^typeWithAnnotation String() + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] var resolveMe: R|@R|Anno|(value#) kotlin/String| + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|@R|Anno|(value#) kotlin/String| { + ^ R|/typeWithAnnotation|() + } + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] set([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] value: R|@R|Anno|(value#) kotlin/String|): R|kotlin/Unit| { + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val value: R|kotlin/Int| = Int(0) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + public final [ResolvedTo(CONTRACTS)] fun typeWithAnnotation(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^typeWithAnnotation String() + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] var resolveMe: R|@R|Anno|(number = R|/value|) kotlin/String| + public [ResolvedTo(ANNOTATION_ARGUMENTS)] get(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^ R|/typeWithAnnotation|() + } + public [ResolvedTo(ANNOTATION_ARGUMENTS)] set([ResolvedTo(ANNOTATION_ARGUMENTS)] value: R|@R|Anno|(number = R|/value|) kotlin/String|): R|kotlin/Unit| { + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] impliciyTypeWithAnnotationOnProperty.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val value: R|kotlin/Int| = Int(0) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/Int| + public final [ResolvedTo(CONTRACTS)] fun typeWithAnnotation(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^typeWithAnnotation String() + } + public final [ResolvedTo(BODY_RESOLVE)] var resolveMe: R|@R|Anno|(number = R|/value|) kotlin/String| + public [ResolvedTo(BODY_RESOLVE)] get(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^ R|/typeWithAnnotation|() + } + public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|Anno|(number = R|/value|) kotlin/String|): R|kotlin/Unit| { + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] impliciyTypeWithAnnotationOnProperty.kt + @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Anno : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/Anno.number] number: R|kotlin/Int|): R|Anno| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val number: R|kotlin/Int| = R|/number| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): R|kotlin/Int| + + } + public final const [ResolvedTo(BODY_RESOLVE)] val value: R|kotlin/Int| = Int(0) + public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int| + public final [ResolvedTo(BODY_RESOLVE)] fun typeWithAnnotation(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^typeWithAnnotation String() + } + public final [ResolvedTo(BODY_RESOLVE)] var resolveMe: R|@R|Anno|(number = R|/value|) kotlin/String| + public [ResolvedTo(BODY_RESOLVE)] get(): R|@R|Anno|(number = R|/value|) kotlin/String| { + ^ R|/typeWithAnnotation|() + } + public [ResolvedTo(BODY_RESOLVE)] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|Anno|(number = R|/value|) kotlin/String|): R|kotlin/Unit| { + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.kt b/analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.kt new file mode 100644 index 00000000000..a21f6830043 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.kt @@ -0,0 +1,4 @@ +@Target(AnnotationTarget.TYPE) +annotation class TypeAnnWithArg(val arg: String) + +typealias BadArgsInTypeAlias = List<@TypeAnnWithArg Int> \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.txt b/analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.txt new file mode 100644 index 00000000000..86bf8c3aefb --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.txt @@ -0,0 +1,168 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] typeAliasWithAnnotationOnType.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public? final [ResolvedTo(RAW_FIR)] typealias BadArgsInTypeAlias = List<@TypeAnnWithArg[Unresolved]() Int> + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public? final [ResolvedTo(RAW_FIR)] typealias BadArgsInTypeAlias = List<@TypeAnnWithArg[Unresolved]() Int> + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public? final [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] typealias BadArgsInTypeAlias = List<@TypeAnnWithArg[Unresolved]() Int> + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @Target[Unresolved](LAZY_EXPRESSION) public? final? [ResolvedTo(RAW_FIR)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public? final [ResolvedTo(COMPANION_GENERATION)] typealias BadArgsInTypeAlias = List<@TypeAnnWithArg[Unresolved]() Int> + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public? final [ResolvedTo(SUPER_TYPES)] typealias BadArgsInTypeAlias = R|kotlin/collections/List<@R|TypeAnnWithArg|() kotlin/Int>| + +TYPES: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public? final [ResolvedTo(TYPES)] typealias BadArgsInTypeAlias = R|kotlin/collections/List<@R|TypeAnnWithArg|() kotlin/Int>| + +STATUS: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public final [ResolvedTo(STATUS)] typealias BadArgsInTypeAlias = R|kotlin/collections/List<@R|TypeAnnWithArg|() kotlin/Int>| + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] typealias BadArgsInTypeAlias = R|kotlin/collections/List<@R|TypeAnnWithArg|() kotlin/Int>| + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public final [ResolvedTo(CONTRACTS)] typealias BadArgsInTypeAlias = R|kotlin/collections/List<@R|TypeAnnWithArg|() kotlin/Int>| + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @R|kotlin/annotation/Target|[CompilerRequiredAnnotations](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(RAW_FIR)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: String): R|TypeAnnWithArg| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val arg: String = R|/arg| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=TypeAnnWithArg] get(): String + + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] typealias BadArgsInTypeAlias = R|kotlin/collections/List<@R|TypeAnnWithArg|() kotlin/Int>| + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public [ResolvedTo(EXPECT_ACTUAL_MATCHING)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(EXPECT_ACTUAL_MATCHING)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: R|kotlin/String|): R|TypeAnnWithArg| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val arg: R|kotlin/String| = R|/arg| + public [ResolvedTo(STATUS)] [ContainingClassKey=TypeAnnWithArg] get(): R|kotlin/String| + + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] typealias BadArgsInTypeAlias = R|kotlin/collections/List<@R|TypeAnnWithArg|() kotlin/Int>| + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] typeAliasWithAnnotationOnType.kt + @R|kotlin/annotation/Target|[Types](Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|) public final [ResolvedTo(STATUS)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public [ResolvedTo(EXPECT_ACTUAL_MATCHING)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(EXPECT_ACTUAL_MATCHING)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: R|kotlin/String|): R|TypeAnnWithArg| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val arg: R|kotlin/String| = R|/arg| + public [ResolvedTo(STATUS)] [ContainingClassKey=TypeAnnWithArg] get(): R|kotlin/String| + + } + public final [ResolvedTo(BODY_RESOLVE)] typealias BadArgsInTypeAlias = R|kotlin/collections/List<@R|TypeAnnWithArg|() kotlin/Int>| + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] typeAliasWithAnnotationOnType.kt + @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|)) public final [ResolvedTo(BODY_RESOLVE)] annotation class TypeAnnWithArg : R|kotlin/Annotation| { + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=TypeAnnWithArg] constructor([ResolvedTo(BODY_RESOLVE)] [CorrespondingProperty=/TypeAnnWithArg.arg] arg: R|kotlin/String|): R|TypeAnnWithArg| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val arg: R|kotlin/String| = R|/arg| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=TypeAnnWithArg] get(): R|kotlin/String| + + } + public final [ResolvedTo(BODY_RESOLVE)] typealias BadArgsInTypeAlias = R|kotlin/collections/List<@R|TypeAnnWithArg|() kotlin/Int>| 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 0df67dae454..3af30853456 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 @@ -324,6 +324,12 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.kt"); } + @Test + @TestMetadata("implicitTypeWithInaccessibleAnnotation.kt") + public void testImplicitTypeWithInaccessibleAnnotation() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.kt"); + } + @Test @TestMetadata("lambdaAsSAMInterface.kt") public void testLambdaAsSAMInterface() throws Exception { @@ -857,6 +863,18 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/typeArgumentInAnnotation.kt"); } + @Test + @TestMetadata("typePropagationFromFunctionWithInaccessibleAnnotationArgument.kt") + public void testTypePropagationFromFunctionWithInaccessibleAnnotationArgument() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.kt"); + } + + @Test + @TestMetadata("typePropagationFromPropertyWithInaccessibleAnnotationArgument.kt") + public void testTypePropagationFromPropertyWithInaccessibleAnnotationArgument() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.kt"); + } + @Test @TestMetadata("unresolvedAnnotationOnFunctionType.kt") public void testUnresolvedAnnotationOnFunctionType() throws Exception { @@ -967,6 +985,18 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/hierarchyWithOverrideAndNestedClass4.kt"); } + @Test + @TestMetadata("impliciyTypeWithAnnotationOnFunction.kt") + public void testImpliciyTypeWithAnnotationOnFunction() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.kt"); + } + + @Test + @TestMetadata("impliciyTypeWithAnnotationOnProperty.kt") + public void testImpliciyTypeWithAnnotationOnProperty() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.kt"); + } + @Test @TestMetadata("propertyGetterWithExplicitType.kt") public void testPropertyGetterWithExplicitType() throws Exception { @@ -1095,6 +1125,12 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/lazyResolve/typeAliases"), Pattern.compile("^(.+)\\.(kt)$"), null, true); } + @Test + @TestMetadata("typeAliasWithAnnotationOnType.kt") + public void testTypeAliasWithAnnotationOnType() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.kt"); + } + @Test @TestMetadata("typeAliasWithTypeParameters.kt") public void testTypeAliasWithTypeParameters() 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 6c5ee95b582..9d9da0e6dc1 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 @@ -324,6 +324,12 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeOnFunctionWithWrongRawContract.kt"); } + @Test + @TestMetadata("implicitTypeWithInaccessibleAnnotation.kt") + public void testImplicitTypeWithInaccessibleAnnotation() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/implicitTypeWithInaccessibleAnnotation.kt"); + } + @Test @TestMetadata("lambdaAsSAMInterface.kt") public void testLambdaAsSAMInterface() throws Exception { @@ -857,6 +863,18 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/typeArgumentInAnnotation.kt"); } + @Test + @TestMetadata("typePropagationFromFunctionWithInaccessibleAnnotationArgument.kt") + public void testTypePropagationFromFunctionWithInaccessibleAnnotationArgument() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromFunctionWithInaccessibleAnnotationArgument.kt"); + } + + @Test + @TestMetadata("typePropagationFromPropertyWithInaccessibleAnnotationArgument.kt") + public void testTypePropagationFromPropertyWithInaccessibleAnnotationArgument() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/functions/typePropagationFromPropertyWithInaccessibleAnnotationArgument.kt"); + } + @Test @TestMetadata("unresolvedAnnotationOnFunctionType.kt") public void testUnresolvedAnnotationOnFunctionType() throws Exception { @@ -967,6 +985,18 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/hierarchyWithOverrideAndNestedClass4.kt"); } + @Test + @TestMetadata("impliciyTypeWithAnnotationOnFunction.kt") + public void testImpliciyTypeWithAnnotationOnFunction() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnFunction.kt"); + } + + @Test + @TestMetadata("impliciyTypeWithAnnotationOnProperty.kt") + public void testImpliciyTypeWithAnnotationOnProperty() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/properties/impliciyTypeWithAnnotationOnProperty.kt"); + } + @Test @TestMetadata("propertyGetterWithExplicitType.kt") public void testPropertyGetterWithExplicitType() throws Exception { @@ -1095,6 +1125,12 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/lazyResolve/typeAliases"), Pattern.compile("^(.+)\\.(kt)$"), null, true); } + @Test + @TestMetadata("typeAliasWithAnnotationOnType.kt") + public void testTypeAliasWithAnnotationOnType() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/typeAliases/typeAliasWithAnnotationOnType.kt"); + } + @Test @TestMetadata("typeAliasWithTypeParameters.kt") public void testTypeAliasWithTypeParameters() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index 0732c18a821..c86ae3ffdb3 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -3059,6 +3059,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/typeUse"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); } + @Test + @TestMetadata("implicitTypeWithInaccessibleAnnotation.kt") + public void testImplicitTypeWithInaccessibleAnnotation() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt"); + } + @Test @TestMetadata("kt19455.kt") public void testKt19455() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index 79b94052f48..792d8e920b5 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -3059,6 +3059,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/typeUse"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); } + @Test + @TestMetadata("implicitTypeWithInaccessibleAnnotation.kt") + public void testImplicitTypeWithInaccessibleAnnotation() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt"); + } + @Test @TestMetadata("kt19455.kt") public void testKt19455() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 61ead43d606..751720c78d5 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -3053,6 +3053,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/typeUse"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); } + @Test + @TestMetadata("implicitTypeWithInaccessibleAnnotation.kt") + public void testImplicitTypeWithInaccessibleAnnotation() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt"); + } + @Test @TestMetadata("kt19455.kt") public void testKt19455() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 623881c1255..dc29540349d 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -3059,6 +3059,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/typeUse"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); } + @Test + @TestMetadata("implicitTypeWithInaccessibleAnnotation.kt") + public void testImplicitTypeWithInaccessibleAnnotation() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt"); + } + @Test @TestMetadata("kt19455.kt") public void testKt19455() throws Exception { diff --git a/compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.fir.kt b/compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.fir.kt new file mode 100644 index 00000000000..fde14218f92 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.fir.kt @@ -0,0 +1,14 @@ +package usage + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val s: String) + +fun implicitType1() = TopLevelObject.expectedType() + +object TopLevelObject { + fun expectedType2(): @Anno(privateConstVal) Int = 4 + private const val privateConstVal = "privateConstVal" + fun expectedType(): @Anno(privateConstVal) Int = 4 +} + +fun implicitType2() = TopLevelObject.expectedType2() diff --git a/compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt b/compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt new file mode 100644 index 00000000000..a8cf1dbbec1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt @@ -0,0 +1,14 @@ +package usage + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val s: String) + +fun implicitType1() = TopLevelObject.expectedType() + +object TopLevelObject { + fun expectedType2(): @Anno(privateConstVal) Int = 4 + private const val privateConstVal = "privateConstVal" + fun expectedType(): @Anno(privateConstVal) Int = 4 +} + +fun implicitType2() = TopLevelObject.expectedType2() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.reversed.kt b/compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.reversed.kt new file mode 100644 index 00000000000..9c811747abe --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.reversed.kt @@ -0,0 +1,14 @@ +package usage + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val s: String) + +fun implicitType1() = TopLevelObject.expectedType() + +object TopLevelObject { + fun expectedType2(): @Anno(privateConstVal) Int = 4 + private const val privateConstVal = "privateConstVal" + fun expectedType(): @Anno(privateConstVal) Int = 4 +} + +fun implicitType2() = TopLevelObject.expectedType2() diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 3fb0af87203..ab11faed41f 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -3059,6 +3059,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/annotations/typeUse"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); } + @Test + @TestMetadata("implicitTypeWithInaccessibleAnnotation.kt") + public void testImplicitTypeWithInaccessibleAnnotation() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/typeUse/implicitTypeWithInaccessibleAnnotation.kt"); + } + @Test @TestMetadata("kt19455.kt") public void testKt19455() throws Exception {