diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereFunction.kt b/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereFunction.kt new file mode 100644 index 00000000000..82c4f144e31 --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereFunction.kt @@ -0,0 +1,9 @@ +// LOOK_UP_FOR_ELEMENT_OF_TYPE: KtAnnotationEntry + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val s: String) + +interface One +interface Two + +fun foo(t: T) where T : One, T : @Anno("str") Two = t \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereFunction.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereFunction.txt new file mode 100644 index 00000000000..d2de8dc7998 --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereFunction.txt @@ -0,0 +1,25 @@ +KT element: KtAnnotationEntry +FIR element: FirAnnotationCallImpl +FIR source kind: KtRealSourceElementKind + +FIR element rendered: +@R|Anno|[Types](s = String(str)) + +FIR FILE: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: R|kotlin/String|): R|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(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] fun <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|@R|Anno|(s = String(str)) Two|> foo([ResolvedTo(BODY_RESOLVE)] t: R|T|): R|T| { + ^foo R|/t| + } diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereProperty.kt b/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereProperty.kt new file mode 100644 index 00000000000..9d9110f7a4e --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereProperty.kt @@ -0,0 +1,9 @@ +// LOOK_UP_FOR_ELEMENT_OF_TYPE: KtAnnotationEntry + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val s: String) + +interface One +interface Two + +val T.foo where T : One, T : @Anno("str") Two get() = this \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereProperty.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereProperty.txt new file mode 100644 index 00000000000..b3c8e5a4722 --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereProperty.txt @@ -0,0 +1,26 @@ +KT element: KtAnnotationEntry +FIR element: FirAnnotationCallImpl +FIR source kind: KtRealSourceElementKind + +FIR element rendered: +@R|Anno|[Types](s = String(str)) + +FIR FILE: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: R|kotlin/String|): R|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 abstract [ResolvedTo(STATUS)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(STATUS)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] val <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|@R|Anno|(s = String(str)) Two|> R|T|.foo: R|T| + public [ResolvedTo(BODY_RESOLVE)] get(): R|T| { + ^ this@R|/foo| + } diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereFunction.kt b/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereFunction.kt new file mode 100644 index 00000000000..0bd435d4ed0 --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereFunction.kt @@ -0,0 +1,4 @@ +interface One +interface Two + +fun foo(t: T) where T : One, T : Two = t \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereFunction.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereFunction.txt new file mode 100644 index 00000000000..a6dfaeb8841 --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereFunction.txt @@ -0,0 +1,16 @@ +KT element: KtTypeReference +FIR element: FirResolvedTypeRefImpl +FIR source kind: KtRealSourceElementKind + +FIR element rendered: +R|Two| + +FIR FILE: +FILE: [ResolvedTo(IMPORTS)] whereFunction.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] fun <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|Two|> foo([ResolvedTo(BODY_RESOLVE)] t: R|T|): R|T| { + ^foo R|/t| + } diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereProperty.kt b/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereProperty.kt new file mode 100644 index 00000000000..dc159bbc04e --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereProperty.kt @@ -0,0 +1,4 @@ +interface One +interface Two + +val T.foo where T : One, T : Two get() = this \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereProperty.txt b/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereProperty.txt new file mode 100644 index 00000000000..07186641969 --- /dev/null +++ b/analysis/low-level-api-fir/testData/getOrBuildFir/types/whereProperty.txt @@ -0,0 +1,17 @@ +KT element: KtTypeReference +FIR element: FirResolvedTypeRefImpl +FIR source kind: KtRealSourceElementKind + +FIR element rendered: +R|Two| + +FIR FILE: +FILE: [ResolvedTo(IMPORTS)] whereProperty.kt + public abstract [ResolvedTo(STATUS)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(STATUS)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] val <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|Two|> R|T|.foo: R|T| + public [ResolvedTo(BODY_RESOLVE)] get(): R|T| { + ^ this@R|/foo| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereFunction.kt b/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereFunction.kt new file mode 100644 index 00000000000..95572d9a5c3 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereFunction.kt @@ -0,0 +1,7 @@ +@Target(AnnotationTarget.TYPE) +annotation class Anno(val s: String) + +interface One +interface Two + +fun foo(t: T) where T : One, T : @Anno("str") Two = t \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereFunction.txt b/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereFunction.txt new file mode 100644 index 00000000000..8bda31eb968 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereFunction.txt @@ -0,0 +1,228 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] fun <[ResolvedTo(RAW_FIR)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> foo([ResolvedTo(RAW_FIR)] t: T): { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] fun <[ResolvedTo(RAW_FIR)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> foo([ResolvedTo(RAW_FIR)] t: T): { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun <[ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> foo([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] t: T): { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(COMPANION_GENERATION)] fun <[ResolvedTo(COMPANION_GENERATION)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> foo([ResolvedTo(COMPANION_GENERATION)] t: T): { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(SUPER_TYPES)] fun <[ResolvedTo(SUPER_TYPES)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> foo([ResolvedTo(SUPER_TYPES)] t: T): { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(TYPES)] fun <[ResolvedTo(TYPES)] T : R|One|, R|@R|Anno|(String(str)) Two|> foo([ResolvedTo(TYPES)] t: R|T|): { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] fun <[ResolvedTo(STATUS)] T : R|One|, R|@R|Anno|(String(str)) Two|> foo([ResolvedTo(STATUS)] t: R|T|): { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun <[ResolvedTo(EXPECT_ACTUAL_MATCHING)] T : R|One|, R|@R|Anno|(String(str)) Two|> foo([ResolvedTo(EXPECT_ACTUAL_MATCHING)] t: R|T|): { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(CONTRACTS)] fun <[ResolvedTo(CONTRACTS)] T : R|One|, R|@R|Anno|(String(str)) Two|> foo([ResolvedTo(CONTRACTS)] t: R|T|): { LAZY_BLOCK } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun <[ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T : R|One|, R|@R|Anno|(String(str)) Two|> foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] t: R|T|): R|T| { + ^foo R|/t| + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: R|kotlin/String|): R|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(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun <[ResolvedTo(ANNOTATION_ARGUMENTS)] T : R|One|, R|@R|Anno|(s = String(str)) Two|> foo([ResolvedTo(ANNOTATION_ARGUMENTS)] t: R|T|): R|T| { + ^foo R|/t| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereFunction.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.s] s: R|kotlin/String|): R|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(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] fun <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|@R|Anno|(s = String(str)) Two|> foo([ResolvedTo(BODY_RESOLVE)] t: R|T|): R|T| { + ^foo R|/t| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] annotationInsideWhereFunction.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.s] s: R|kotlin/String|): R|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 abstract [ResolvedTo(BODY_RESOLVE)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(BODY_RESOLVE)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] fun <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|@R|Anno|(s = String(str)) Two|> foo([ResolvedTo(BODY_RESOLVE)] t: R|T|): R|T| { + ^foo R|/t| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereProperty.kt b/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereProperty.kt new file mode 100644 index 00000000000..2151fed2ee8 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereProperty.kt @@ -0,0 +1,7 @@ +@Target(AnnotationTarget.TYPE) +annotation class Anno(val s: String) + +interface One +interface Two + +val T.foo where T : One, T : @Anno("str") Two get() = this \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereProperty.txt b/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereProperty.txt new file mode 100644 index 00000000000..f689ae1d49b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereProperty.txt @@ -0,0 +1,243 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] annotationInsideWhereProperty.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] val <[ResolvedTo(RAW_FIR)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> T.foo: + public? [ResolvedTo(RAW_FIR)] get(): { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] val <[ResolvedTo(RAW_FIR)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> T.foo: + public? [ResolvedTo(RAW_FIR)] get(): { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] val <[ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> T.foo: + public? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] get(): { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(COMPANION_GENERATION)] val <[ResolvedTo(COMPANION_GENERATION)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> T.foo: + public? [ResolvedTo(COMPANION_GENERATION)] get(): { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(SUPER_TYPES)] val <[ResolvedTo(SUPER_TYPES)] T : One, @Anno[Unresolved](LAZY_EXPRESSION) Two> T.foo: + public? [ResolvedTo(SUPER_TYPES)] get(): { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(TYPES)] val <[ResolvedTo(TYPES)] T : R|One|, R|@R|Anno|(String(str)) Two|> R|T|.foo: + public? [ResolvedTo(TYPES)] get(): { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] val <[ResolvedTo(STATUS)] T : R|One|, R|@R|Anno|(String(str)) Two|> R|T|.foo: + public [ResolvedTo(STATUS)] get(): { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] val <[ResolvedTo(EXPECT_ACTUAL_MATCHING)] T : R|One|, R|@R|Anno|(String(str)) Two|> R|T|.foo: + public [ResolvedTo(EXPECT_ACTUAL_MATCHING)] get(): { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: String): R|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)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(CONTRACTS)] val <[ResolvedTo(CONTRACTS)] T : R|One|, R|@R|Anno|(String(str)) Two|> R|T|.foo: + public [ResolvedTo(CONTRACTS)] get(): { + ^ this# + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: String): R|Anno| { + LAZY_super + } + + public? final? [ResolvedTo(RAW_FIR)] [IsFromPrimaryConstructor=true] val s: String = R|/s| + public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Anno] get(): String + + } + public abstract [ResolvedTo(STATUS)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(STATUS)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val <[ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T : R|One|, R|@R|Anno|(String(str)) Two|> R|T|.foo: R|T| + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|T| { + ^ this@R|/foo| + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: R|kotlin/String|): R|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 abstract [ResolvedTo(STATUS)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(STATUS)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] val <[ResolvedTo(ANNOTATION_ARGUMENTS)] T : R|One|, R|@R|Anno|(s = String(str)) Two|> R|T|.foo: R|T| + public [ResolvedTo(ANNOTATION_ARGUMENTS)] get(): R|T| { + ^ this@R|/foo| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] annotationInsideWhereProperty.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.s] s: R|kotlin/String|): R|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 abstract [ResolvedTo(STATUS)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(STATUS)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] val <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|@R|Anno|(s = String(str)) Two|> R|T|.foo: R|T| + public [ResolvedTo(BODY_RESOLVE)] get(): R|T| { + ^ this@R|/foo| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] annotationInsideWhereProperty.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.s] s: R|kotlin/String|): R|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 abstract [ResolvedTo(BODY_RESOLVE)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(BODY_RESOLVE)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] val <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|@R|Anno|(s = String(str)) Two|> R|T|.foo: R|T| + public [ResolvedTo(BODY_RESOLVE)] get(): R|T| { + ^ this@R|/foo| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functionWithWhere.kt b/analysis/low-level-api-fir/testData/lazyResolve/functionWithWhere.kt new file mode 100644 index 00000000000..051c42de0e5 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/functionWithWhere.kt @@ -0,0 +1,4 @@ +interface One +interface Two + +fun foo(t: T) where T : One, T : Two = t \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/functionWithWhere.txt b/analysis/low-level-api-fir/testData/lazyResolve/functionWithWhere.txt new file mode 100644 index 00000000000..5e70af971c1 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/functionWithWhere.txt @@ -0,0 +1,111 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] fun <[ResolvedTo(RAW_FIR)] T : One, Two> foo([ResolvedTo(RAW_FIR)] t: T): { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] fun <[ResolvedTo(RAW_FIR)] T : One, Two> foo([ResolvedTo(RAW_FIR)] t: T): { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] fun <[ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T : One, Two> foo([ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] t: T): { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(COMPANION_GENERATION)] fun <[ResolvedTo(COMPANION_GENERATION)] T : One, Two> foo([ResolvedTo(COMPANION_GENERATION)] t: T): { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(SUPER_TYPES)] fun <[ResolvedTo(SUPER_TYPES)] T : One, Two> foo([ResolvedTo(SUPER_TYPES)] t: T): { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(TYPES)] fun <[ResolvedTo(TYPES)] T : R|One|, R|Two|> foo([ResolvedTo(TYPES)] t: R|T|): { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] fun <[ResolvedTo(STATUS)] T : R|One|, R|Two|> foo([ResolvedTo(STATUS)] t: R|T|): { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] fun <[ResolvedTo(EXPECT_ACTUAL_MATCHING)] T : R|One|, R|Two|> foo([ResolvedTo(EXPECT_ACTUAL_MATCHING)] t: R|T|): { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(CONTRACTS)] fun <[ResolvedTo(CONTRACTS)] T : R|One|, R|Two|> foo([ResolvedTo(CONTRACTS)] t: R|T|): { LAZY_BLOCK } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] fun <[ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T : R|One|, R|Two|> foo([ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] t: R|T|): R|T| { + ^foo R|/t| + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] fun <[ResolvedTo(ANNOTATION_ARGUMENTS)] T : R|One|, R|Two|> foo([ResolvedTo(ANNOTATION_ARGUMENTS)] t: R|T|): R|T| { + ^foo R|/t| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] functionWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] fun <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|Two|> foo([ResolvedTo(BODY_RESOLVE)] t: R|T|): R|T| { + ^foo R|/t| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] functionWithWhere.kt + public abstract [ResolvedTo(BODY_RESOLVE)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(BODY_RESOLVE)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] fun <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|Two|> foo([ResolvedTo(BODY_RESOLVE)] t: R|T|): R|T| { + ^foo R|/t| + } diff --git a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithWhere.kt b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithWhere.kt new file mode 100644 index 00000000000..d0dcc6aa19e --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithWhere.kt @@ -0,0 +1,4 @@ +interface One +interface Two + +val T.foo where T : One, T : Two get() = this \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolve/propertyWithWhere.txt b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithWhere.txt new file mode 100644 index 00000000000..8a68c000580 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolve/propertyWithWhere.txt @@ -0,0 +1,126 @@ +RAW_FIR: +FILE: [ResolvedTo(RAW_FIR)] propertyWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] val <[ResolvedTo(RAW_FIR)] T : One, Two> T.foo: + public? [ResolvedTo(RAW_FIR)] get(): { LAZY_BLOCK } + +IMPORTS: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] val <[ResolvedTo(RAW_FIR)] T : One, Two> T.foo: + public? [ResolvedTo(RAW_FIR)] get(): { LAZY_BLOCK } + +COMPILER_REQUIRED_ANNOTATIONS: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] val <[ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] T : One, Two> T.foo: + public? [ResolvedTo(COMPILER_REQUIRED_ANNOTATIONS)] get(): { LAZY_BLOCK } + +COMPANION_GENERATION: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(COMPANION_GENERATION)] val <[ResolvedTo(COMPANION_GENERATION)] T : One, Two> T.foo: + public? [ResolvedTo(COMPANION_GENERATION)] get(): { LAZY_BLOCK } + +SUPER_TYPES: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(SUPER_TYPES)] val <[ResolvedTo(SUPER_TYPES)] T : One, Two> T.foo: + public? [ResolvedTo(SUPER_TYPES)] get(): { LAZY_BLOCK } + +TYPES: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public? final? [ResolvedTo(TYPES)] val <[ResolvedTo(TYPES)] T : R|One|, R|Two|> R|T|.foo: + public? [ResolvedTo(TYPES)] get(): { LAZY_BLOCK } + +STATUS: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(STATUS)] val <[ResolvedTo(STATUS)] T : R|One|, R|Two|> R|T|.foo: + public [ResolvedTo(STATUS)] get(): { LAZY_BLOCK } + +EXPECT_ACTUAL_MATCHING: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(EXPECT_ACTUAL_MATCHING)] val <[ResolvedTo(EXPECT_ACTUAL_MATCHING)] T : R|One|, R|Two|> R|T|.foo: + public [ResolvedTo(EXPECT_ACTUAL_MATCHING)] get(): { LAZY_BLOCK } + +CONTRACTS: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public? final? [ResolvedTo(RAW_FIR)] interface One : R|kotlin/Any| { + } + public? final? [ResolvedTo(RAW_FIR)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(CONTRACTS)] val <[ResolvedTo(CONTRACTS)] T : R|One|, R|Two|> R|T|.foo: + public [ResolvedTo(CONTRACTS)] get(): { + ^ this# + } + +IMPLICIT_TYPES_BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public abstract [ResolvedTo(STATUS)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(STATUS)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] val <[ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] T : R|One|, R|Two|> R|T|.foo: R|T| + public [ResolvedTo(IMPLICIT_TYPES_BODY_RESOLVE)] get(): R|T| { + ^ this@R|/foo| + } + +ANNOTATION_ARGUMENTS: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public abstract [ResolvedTo(STATUS)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(STATUS)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(ANNOTATION_ARGUMENTS)] val <[ResolvedTo(ANNOTATION_ARGUMENTS)] T : R|One|, R|Two|> R|T|.foo: R|T| + public [ResolvedTo(ANNOTATION_ARGUMENTS)] get(): R|T| { + ^ this@R|/foo| + } + +BODY_RESOLVE: +FILE: [ResolvedTo(IMPORTS)] propertyWithWhere.kt + public abstract [ResolvedTo(STATUS)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(STATUS)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] val <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|Two|> R|T|.foo: R|T| + public [ResolvedTo(BODY_RESOLVE)] get(): R|T| { + ^ this@R|/foo| + } + +FILE RAW TO BODY: +FILE: [ResolvedTo(BODY_RESOLVE)] propertyWithWhere.kt + public abstract [ResolvedTo(BODY_RESOLVE)] interface One : R|kotlin/Any| { + } + public abstract [ResolvedTo(BODY_RESOLVE)] interface Two : R|kotlin/Any| { + } + public final [ResolvedTo(BODY_RESOLVE)] val <[ResolvedTo(BODY_RESOLVE)] T : R|One|, R|Two|> R|T|.foo: R|T| + public [ResolvedTo(BODY_RESOLVE)] get(): R|T| { + ^ this@R|/foo| + } 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 08cdbfe4d3f..ba8c60c9404 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 @@ -48,6 +48,18 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testData/lazyResolve/annotationFromImplicitJavaTypeWithJavaAnnotation.kt"); } + @Test + @TestMetadata("annotationInsideWhereFunction.kt") + public void testAnnotationInsideWhereFunction() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereFunction.kt"); + } + + @Test + @TestMetadata("annotationInsideWhereProperty.kt") + public void testAnnotationInsideWhereProperty() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereProperty.kt"); + } + @Test @TestMetadata("annotationOnLocalClass.kt") public void testAnnotationOnLocalClass() throws Exception { @@ -288,6 +300,12 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testData/lazyResolve/functionWithParameter.kt"); } + @Test + @TestMetadata("functionWithWhere.kt") + public void testFunctionWithWhere() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/functionWithWhere.kt"); + } + @Test @TestMetadata("implicitTypeOnFunctionWithRawContract.kt") public void testImplicitTypeOnFunctionWithRawContract() throws Exception { @@ -456,6 +474,12 @@ public class FirOutOfContentRootLazyDeclarationResolveTestGenerated extends Abst runTest("analysis/low-level-api-fir/testData/lazyResolve/propertyWithInitializer.kt"); } + @Test + @TestMetadata("propertyWithWhere.kt") + public void testPropertyWithWhere() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/propertyWithWhere.kt"); + } + @Test @TestMetadata("redeclaration.kt") public void testRedeclaration() 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 0804a2d4bd5..e88e1b66e7b 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 @@ -48,6 +48,18 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testData/lazyResolve/annotationFromImplicitJavaTypeWithJavaAnnotation.kt"); } + @Test + @TestMetadata("annotationInsideWhereFunction.kt") + public void testAnnotationInsideWhereFunction() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereFunction.kt"); + } + + @Test + @TestMetadata("annotationInsideWhereProperty.kt") + public void testAnnotationInsideWhereProperty() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/annotationInsideWhereProperty.kt"); + } + @Test @TestMetadata("annotationOnLocalClass.kt") public void testAnnotationOnLocalClass() throws Exception { @@ -288,6 +300,12 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testData/lazyResolve/functionWithParameter.kt"); } + @Test + @TestMetadata("functionWithWhere.kt") + public void testFunctionWithWhere() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/functionWithWhere.kt"); + } + @Test @TestMetadata("implicitTypeOnFunctionWithRawContract.kt") public void testImplicitTypeOnFunctionWithRawContract() throws Exception { @@ -456,6 +474,12 @@ public class FirSourceLazyDeclarationResolveTestGenerated extends AbstractFirSou runTest("analysis/low-level-api-fir/testData/lazyResolve/propertyWithInitializer.kt"); } + @Test + @TestMetadata("propertyWithWhere.kt") + public void testPropertyWithWhere() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolve/propertyWithWhere.kt"); + } + @Test @TestMetadata("redeclaration.kt") public void testRedeclaration() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java index 54cfcf869e7..7e8cd5a429e 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java @@ -75,6 +75,18 @@ public class OutOfContentRootGetOrBuildFirTestGenerated extends AbstractOutOfCon runTest("analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationApplicationWithArgumentsOnCallSite.kt"); } + @Test + @TestMetadata("annotationInsideWhereFunction.kt") + public void testAnnotationInsideWhereFunction() throws Exception { + runTest("analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereFunction.kt"); + } + + @Test + @TestMetadata("annotationInsideWhereProperty.kt") + public void testAnnotationInsideWhereProperty() throws Exception { + runTest("analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereProperty.kt"); + } + @Test @TestMetadata("annotationOnConstructorProperty.kt") public void testAnnotationOnConstructorProperty() throws Exception { @@ -1189,6 +1201,18 @@ public class OutOfContentRootGetOrBuildFirTestGenerated extends AbstractOutOfCon runTest("analysis/low-level-api-fir/testData/getOrBuildFir/types/unresolvedTypeConsturctorResolvedTypeArgument.kt"); } + @Test + @TestMetadata("whereFunction.kt") + public void testWhereFunction() throws Exception { + runTest("analysis/low-level-api-fir/testData/getOrBuildFir/types/whereFunction.kt"); + } + + @Test + @TestMetadata("whereProperty.kt") + public void testWhereProperty() throws Exception { + runTest("analysis/low-level-api-fir/testData/getOrBuildFir/types/whereProperty.kt"); + } + @Test @TestMetadata("wholeType.kt") public void testWholeType() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java index 35732ffe082..f7bbeab1627 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java @@ -75,6 +75,18 @@ public class SourceGetOrBuildFirTestGenerated extends AbstractSourceGetOrBuildFi runTest("analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationApplicationWithArgumentsOnCallSite.kt"); } + @Test + @TestMetadata("annotationInsideWhereFunction.kt") + public void testAnnotationInsideWhereFunction() throws Exception { + runTest("analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereFunction.kt"); + } + + @Test + @TestMetadata("annotationInsideWhereProperty.kt") + public void testAnnotationInsideWhereProperty() throws Exception { + runTest("analysis/low-level-api-fir/testData/getOrBuildFir/annotations/annotationInsideWhereProperty.kt"); + } + @Test @TestMetadata("annotationOnConstructorProperty.kt") public void testAnnotationOnConstructorProperty() throws Exception { @@ -1189,6 +1201,18 @@ public class SourceGetOrBuildFirTestGenerated extends AbstractSourceGetOrBuildFi runTest("analysis/low-level-api-fir/testData/getOrBuildFir/types/unresolvedTypeConsturctorResolvedTypeArgument.kt"); } + @Test + @TestMetadata("whereFunction.kt") + public void testWhereFunction() throws Exception { + runTest("analysis/low-level-api-fir/testData/getOrBuildFir/types/whereFunction.kt"); + } + + @Test + @TestMetadata("whereProperty.kt") + public void testWhereProperty() throws Exception { + runTest("analysis/low-level-api-fir/testData/getOrBuildFir/types/whereProperty.kt"); + } + @Test @TestMetadata("wholeType.kt") public void testWholeType() throws Exception {