diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.after.txt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.after.txt new file mode 100644 index 00000000000..3fbb1d6fdce --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.after.txt @@ -0,0 +1,39 @@ +@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>> + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String> + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>> + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String> + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.before.txt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.before.txt new file mode 100644 index 00000000000..2617e910545 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.before.txt @@ -0,0 +1,39 @@ +@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>> + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String> + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>> + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String> + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String + context -> FirNamedFunctionSymbol /foo + anchor -> [FirNamedFunctionSymbol /foo] + +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.kt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.kt new file mode 100644 index 00000000000..1725c467458 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.kt @@ -0,0 +1,6 @@ +@Target(AnnotationTarget.TYPE) +annotation class Anno(val position: String) + +const val prop = "str" + +fun @Anno("receiver type $prop") List<@Anno("nested receiver type $prop") Collection<@Anno("nested nested receiver type $prop") String>>.foo() = this \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.lazyResolve.txt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.lazyResolve.txt new file mode 100644 index 00000000000..449205ca125 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnType.lazyResolve.txt @@ -0,0 +1,202 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] receiverAsImplicitReturnType.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(COMPANION_GENERATION)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(SUPER_TYPES)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(TYPES)] fun R|@R|Anno|((String(receiver type ), prop#)) kotlin/collections/List<@R|Anno|((String(nested receiver type ), prop#)) kotlin/collections/Collection<@R|Anno|((String(nested nested receiver type ), prop#)) kotlin/String>>|.foo(): { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(STATUS)] fun R|@R|Anno|((String(receiver type ), prop#)) kotlin/collections/List<@R|Anno|((String(nested receiver type ), prop#)) kotlin/collections/Collection<@R|Anno|((String(nested nested receiver type ), prop#)) kotlin/String>>|.foo(): { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun R|@R|Anno|((String(receiver type ), prop#)) kotlin/collections/List<@R|Anno|((String(nested receiver type ), prop#)) kotlin/collections/Collection<@R|Anno|((String(nested nested receiver type ), prop#)) kotlin/String>>|.foo(): { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(CONTRACTS)] fun R|@R|Anno|((String(receiver type ), prop#)) kotlin/collections/List<@R|Anno|((String(nested receiver type ), prop#)) kotlin/collections/Collection<@R|Anno|((String(nested nested receiver type ), prop#)) kotlin/String>>|.foo(): { LAZY_BLOCK } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnType.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(BODY_RESOLVE)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] receiverAsImplicitReturnType.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.position] position: R|kotlin/String|): R|Anno| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(BODY_RESOLVE)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.after.txt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.after.txt new file mode 100644 index 00000000000..791be875fa2 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.after.txt @@ -0,0 +1,30 @@ +@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>> + context -> FirNamedFunctionSymbol /bar + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String> + context -> FirNamedFunctionSymbol /bar + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String + context -> FirNamedFunctionSymbol /bar + anchor -> [FirNamedFunctionSymbol /foo] + +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [PostponedSymbolsForAnnotationResolutionKey=[FirNamedFunctionSymbol /foo]] fun R|kotlin/collections/List>|.bar(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^bar this@R|/bar|.R|/foo|() + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.before.txt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.before.txt new file mode 100644 index 00000000000..8b082f07db3 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.before.txt @@ -0,0 +1,30 @@ +@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>> + context -> FirNamedFunctionSymbol /bar + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String> + context -> FirNamedFunctionSymbol /bar + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String + context -> FirNamedFunctionSymbol /bar + anchor -> [FirNamedFunctionSymbol /foo] + +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [PostponedSymbolsForAnnotationResolutionKey=[FirNamedFunctionSymbol /foo]] fun R|kotlin/collections/List>|.bar(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^bar this@R|/bar|.R|/foo|() + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.kt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.kt new file mode 100644 index 00000000000..ace6a95ebde --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.kt @@ -0,0 +1,8 @@ +@Target(AnnotationTarget.TYPE) +annotation class Anno(val position: String) + +const val prop = "str" + +fun List>.bar() = foo() + +fun @Anno("receiver type $prop") List<@Anno("nested receiver type $prop") Collection<@Anno("nested nested receiver type $prop") String>>.foo() = this \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.lazyResolve.txt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.lazyResolve.txt new file mode 100644 index 00000000000..c512385450e --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagation.lazyResolve.txt @@ -0,0 +1,223 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] receiverAsImplicitReturnTypePropagation.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun List>.bar(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(RAW_FIR)] fun List>.bar(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun List>.bar(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(COMPANION_GENERATION)] fun List>.bar(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(SUPER_TYPES)] fun List>.bar(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public? final? [ResolvedTo(TYPES)] fun R|kotlin/collections/List>|.bar(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(STATUS)] fun R|kotlin/collections/List>|.bar(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun R|kotlin/collections/List>|.bar(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public? final? const [ResolvedTo(RAW_FIR)] val prop: = LAZY_EXPRESSION + public? [ResolvedTo(RAW_FIR)] get(): + public final [ResolvedTo(CONTRACTS)] fun R|kotlin/collections/List>|.bar(): { LAZY_BLOCK } + public? final? [ResolvedTo(RAW_FIR)] fun @Anno[Unresolved](LAZY_EXPRESSION) List<@Anno[Unresolved](LAZY_EXPRESSION) Collection<@Anno[Unresolved](LAZY_EXPRESSION) String>>.foo(): { LAZY_BLOCK } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] [PostponedSymbolsForAnnotationResolutionKey=[FirNamedFunctionSymbol /foo]] fun R|kotlin/collections/List>|.bar(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^bar this@R|/bar|.R|/foo|() + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun R|kotlin/collections/List>|.bar(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^bar this@R|/bar|.R|/foo|() + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagation.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.position] position: R|kotlin/String|): R|Anno| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(STATUS)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(BODY_RESOLVE)] fun R|kotlin/collections/List>|.bar(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^bar this@R|/bar|.R|/foo|() + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] receiverAsImplicitReturnTypePropagation.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.position] position: R|kotlin/String|): R|Anno| { + super() + } + + public final [ResolvedTo(BODY_RESOLVE)] [IsFromPrimaryConstructor=true] val position: R|kotlin/String| = R|/position| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Anno] get(): R|kotlin/String| + + } + public final const [ResolvedTo(BODY_RESOLVE)] val prop: R|kotlin/String| = String(str) + public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String| + public final [ResolvedTo(BODY_RESOLVE)] fun R|kotlin/collections/List>|.bar(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^bar this@R|/bar|.R|/foo|() + } + public final [ResolvedTo(BODY_RESOLVE)] fun R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>|.foo(): R|@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>>| { + ^foo this@R|/foo| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagationScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagationScript.after.txt new file mode 100644 index 00000000000..bbb0f8db094 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/function/receiverAsImplicitReturnTypePropagationScript.after.txt @@ -0,0 +1,37 @@ +@R|Anno|(position = (String(receiver type ), R|/prop|)) kotlin/collections/List<@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String>> + context -> FirNamedFunctionSymbol /bar + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested receiver type ), R|/prop|)) kotlin/collections/Collection<@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String> + context -> FirNamedFunctionSymbol /bar + anchor -> [FirNamedFunctionSymbol /foo] + +@R|Anno|(position = (String(nested nested receiver type ), R|/prop|)) kotlin/String + context -> FirNamedFunctionSymbol /bar + anchor -> [FirNamedFunctionSymbol /foo] + +FILE: [ResolvedTo(IMPORTS)] receiverAsImplicitReturnTypePropagationScript.kts + context(