KT-61245 [LL API] Collect correct context for class headers
To avoid collecting context which includes the implicit class receiver, context for class header positions is collected before entering the `context.withRegularClass` call
This commit is contained in:
committed by
Space Team
parent
b44632b92f
commit
7ddb4f8324
+6
@@ -326,8 +326,14 @@ private class ContextCollectorVisitor(
|
|||||||
regularClass.lazyResolveToPhase(FirResolvePhase.STATUS)
|
regularClass.lazyResolveToPhase(FirResolvePhase.STATUS)
|
||||||
|
|
||||||
context.withContainingClass(regularClass) {
|
context.withContainingClass(regularClass) {
|
||||||
|
processList(regularClass.contextReceivers)
|
||||||
processList(regularClass.typeParameters)
|
processList(regularClass.typeParameters)
|
||||||
|
|
||||||
|
// we do it before we actually visit the constructors,
|
||||||
|
// because we don't want to have implicit this receiver
|
||||||
|
// for supertype callee positions
|
||||||
|
processList(regularClass.superTypeRefs)
|
||||||
|
|
||||||
context.withRegularClass(regularClass, holder) {
|
context.withRegularClass(regularClass, holder) {
|
||||||
dumpContext(regularClass, ContextKind.BODY)
|
dumpContext(regularClass, ContextKind.BODY)
|
||||||
|
|
||||||
|
|||||||
Vendored
+8
@@ -0,0 +1,8 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
open class Base {
|
||||||
|
class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
context(<expr>Base</expr>)
|
||||||
|
class Child : Base() {}
|
||||||
Vendored
+37
@@ -0,0 +1,37 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] contextReceiver.kt
|
||||||
|
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor(): R|test/Base| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
public? final? [ResolvedTo(RAW_FIR)] class Nested : R|kotlin/Any| {
|
||||||
|
public? [ResolvedTo(RAW_FIR)] constructor(): R|test/Base.Nested| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
context(R|test/Base|)
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Child| {
|
||||||
|
super<R|test/Base|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
open class Base {
|
||||||
|
class Nested
|
||||||
|
|
||||||
|
val fromBase: String = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
class Child(name: String = <expr>"name"</expr>) : Base()
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
Element 7
|
||||||
|
Scope: FirNestedClassifierScopeWithSubstitution
|
||||||
|
Classifiers:
|
||||||
|
FirRegularClassSymbol public final class Nested : R|kotlin/Any|
|
||||||
|
Static scope owner symbol: FirRegularClassSymbol public open class Base : R|kotlin/Any|
|
||||||
|
Element 8
|
||||||
|
Scope: FirLocalScope
|
||||||
|
Properties:
|
||||||
|
FirValueParameterSymbol name: R|kotlin/String| = String(name)
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] primaryConstructorParameter_initializerExpression.kt
|
||||||
|
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Base| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [ResolvedTo(STATUS)] class Nested : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Base.Nested| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [ResolvedTo(BODY_RESOLVE)] val fromBase: R|kotlin/String| = String()
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/String| = String(name)): R|test/Child| {
|
||||||
|
super<R|test/Base|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
open class Base {
|
||||||
|
class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
class Child(name: <expr>String</expr>) : Base()
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
Element 7
|
||||||
|
Scope: FirNestedClassifierScopeWithSubstitution
|
||||||
|
Classifiers:
|
||||||
|
FirRegularClassSymbol public final class Nested : R|kotlin/Any|
|
||||||
|
Static scope owner symbol: FirRegularClassSymbol public open class Base : R|kotlin/Any|
|
||||||
|
Element 8
|
||||||
|
Scope: FirLocalScope
|
||||||
|
Properties:
|
||||||
|
FirValueParameterSymbol name: R|kotlin/String|
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] primaryConstructorParameter_typeRef.kt
|
||||||
|
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Base| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [ResolvedTo(STATUS)] class Nested : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Base.Nested| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/String|): R|test/Child| {
|
||||||
|
super<R|test/Base|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
open class Base(param: Nested) {
|
||||||
|
class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
class Child(primaryConstructorParameter: Nested) : Base(<expr>primaryConstructorParameter</expr>)
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
Element 7
|
||||||
|
Scope: FirNestedClassifierScopeWithSubstitution
|
||||||
|
Classifiers:
|
||||||
|
FirRegularClassSymbol public final class Nested : R|kotlin/Any|
|
||||||
|
Static scope owner symbol: FirRegularClassSymbol public open class Base : R|kotlin/Any|
|
||||||
|
Element 8
|
||||||
|
Scope: FirLocalScope
|
||||||
|
Properties:
|
||||||
|
FirValueParameterSymbol primaryConstructorParameter: R|test/Base.Nested|
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] superTypeCallArgumentsExpression.kt
|
||||||
|
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor([ResolvedTo(STATUS)] param: R|test/Base.Nested|): R|test/Base| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [ResolvedTo(STATUS)] class Nested : R|kotlin/Any| {
|
||||||
|
public? [ResolvedTo(RAW_FIR)] constructor(): R|test/Base.Nested| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] primaryConstructorParameter: R|test/Base.Nested|): R|test/Child| {
|
||||||
|
super<R|test/Base|>(R|<local>/primaryConstructorParameter|)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
open class Base(param: Nested) {
|
||||||
|
class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <T> materialize(): T = TODO()
|
||||||
|
|
||||||
|
class Child(primaryConstructorParameter: Nested) : Base(materialize<<expr>Nested</expr>>())
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
Element 7
|
||||||
|
Scope: FirNestedClassifierScopeWithSubstitution
|
||||||
|
Classifiers:
|
||||||
|
FirRegularClassSymbol public final class Nested : R|kotlin/Any|
|
||||||
|
Static scope owner symbol: FirRegularClassSymbol public open class Base : R|kotlin/Any|
|
||||||
|
Element 8
|
||||||
|
Scope: FirLocalScope
|
||||||
|
Properties:
|
||||||
|
FirValueParameterSymbol primaryConstructorParameter: R|test/Base.Nested|
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] superTypeCallArgumentsTypeRef.kt
|
||||||
|
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor([ResolvedTo(STATUS)] param: R|test/Base.Nested|): R|test/Base| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [ResolvedTo(STATUS)] class Nested : R|kotlin/Any| {
|
||||||
|
public? [ResolvedTo(RAW_FIR)] constructor(): R|test/Base.Nested| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(CONTRACTS)] fun <[ResolvedTo(CONTRACTS)] T> materialize(): R|T| {
|
||||||
|
^materialize TODO#()
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] primaryConstructorParameter: R|test/Base.Nested|): R|test/Child| {
|
||||||
|
super<R|test/Base|>(R|test/materialize|<R|test/Base.Nested|>())
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Vendored
+12
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
open class Base {
|
||||||
|
class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
class Child : <expr>Base</expr>()
|
||||||
Vendored
+36
@@ -0,0 +1,36 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] superTypeCallee.kt
|
||||||
|
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor(): R|test/Base| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
public? final? [ResolvedTo(RAW_FIR)] class Nested : R|kotlin/Any| {
|
||||||
|
public? [ResolvedTo(RAW_FIR)] constructor(): R|test/Base.Nested| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Child| {
|
||||||
|
super<R|test/Base|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/superTypeCalleeGenerics.kt
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
open class Base<T> {
|
||||||
|
class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
class Child : Base<<expr>Any</expr>>()
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] superTypeCalleeGenerics.kt
|
||||||
|
public open [ResolvedTo(STATUS)] class Base<[ResolvedTo(STATUS)] T> : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor<[ResolvedTo(STATUS)] T>(): R|test/Base<T>| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
public? final? [ResolvedTo(RAW_FIR)] class Nested : R|kotlin/Any| {
|
||||||
|
public? [ResolvedTo(RAW_FIR)] constructor(): R|test/Base.Nested| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base<kotlin/Any>| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Child| {
|
||||||
|
super<R|test/Base<kotlin/Any>|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
interface MyInterface
|
||||||
|
|
||||||
|
open class Base {
|
||||||
|
class Nested : MyInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
class Child(constructorParam: MyInterface) : Base(), MyInterface by <expr>Nested()</expr>
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
Element 7
|
||||||
|
Scope: FirNestedClassifierScopeWithSubstitution
|
||||||
|
Classifiers:
|
||||||
|
FirRegularClassSymbol public final class Nested : R|test/MyInterface|
|
||||||
|
Static scope owner symbol: FirRegularClassSymbol public open class Base : R|kotlin/Any|
|
||||||
|
Element 8
|
||||||
|
Scope: FirLocalScope
|
||||||
|
Properties:
|
||||||
|
FirValueParameterSymbol constructorParam: R|test/MyInterface|
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] superTypeDelegatedExpression.kt
|
||||||
|
public abstract [ResolvedTo(STATUS)] interface MyInterface : R|kotlin/Any| {
|
||||||
|
}
|
||||||
|
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor(): R|test/Base| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [ResolvedTo(STATUS)] class Nested : R|test/MyInterface| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor(): R|test/Base.Nested| {
|
||||||
|
LAZY_super<<implicit>>
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base|, R|test/MyInterface| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] constructorParam: R|test/MyInterface|): R|test/Child| {
|
||||||
|
super<R|test/Base|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
private final [ResolvedTo(BODY_RESOLVE)] field $$delegate_0: R|test/MyInterface| = R|test/Base.Nested.Nested|()
|
||||||
|
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
interface MyInterface
|
||||||
|
|
||||||
|
open class Base {
|
||||||
|
class Nested : MyInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
class Child : Base, <expr>MyInterface</expr> by Nested() {
|
||||||
|
constructor(): super()
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] superTypeDelegatedTypeRef.kt
|
||||||
|
public abstract [ResolvedTo(STATUS)] interface MyInterface : R|kotlin/Any| {
|
||||||
|
}
|
||||||
|
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor(): R|test/Base| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [ResolvedTo(STATUS)] class Nested : R|test/MyInterface| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor(): R|test/Base.Nested| {
|
||||||
|
LAZY_super<<implicit>>
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base|, R|test/MyInterface| {
|
||||||
|
private final [ResolvedTo(BODY_RESOLVE)] field $$delegate_0: R|test/MyInterface| = R|test/Base.Nested.Nested|()
|
||||||
|
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Child| {
|
||||||
|
super<R|test/Base|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
open class Base {
|
||||||
|
class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
class Child : <expr>Base</expr> {
|
||||||
|
constructor(): super() {}
|
||||||
|
}
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] superTypeRef.kt
|
||||||
|
public open [ResolvedTo(STATUS)] class Base : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor(): R|test/Base| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
public? final? [ResolvedTo(RAW_FIR)] class Nested : R|kotlin/Any| {
|
||||||
|
public? [ResolvedTo(RAW_FIR)] constructor(): R|test/Base.Nested| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Child| {
|
||||||
|
super<R|test/Base|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Vendored
+14
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
open class Base<T> {
|
||||||
|
class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
class Child : Base<<expr>Any</expr>> {
|
||||||
|
constructor(): super() {}
|
||||||
|
}
|
||||||
Vendored
+36
@@ -0,0 +1,36 @@
|
|||||||
|
Tower Data Context:
|
||||||
|
Element 0
|
||||||
|
Scope: FirDefaultStarImportingScope
|
||||||
|
Element 1
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 2
|
||||||
|
Scope: FirExplicitStarImportingScope
|
||||||
|
Element 3
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 4
|
||||||
|
Scope: FirDefaultSimpleImportingScope
|
||||||
|
Element 5
|
||||||
|
Scope: FirPackageMemberScope
|
||||||
|
Element 6
|
||||||
|
Scope: FirExplicitSimpleImportingScope
|
||||||
|
|
||||||
|
FILE: [ResolvedTo(IMPORTS)] superTypeRefGenerics.kt
|
||||||
|
public open [ResolvedTo(STATUS)] class Base<[ResolvedTo(STATUS)] T> : R|kotlin/Any| {
|
||||||
|
public [ResolvedTo(STATUS)] constructor<[ResolvedTo(STATUS)] T>(): R|test/Base<T>| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
public? final? [ResolvedTo(RAW_FIR)] class Nested : R|kotlin/Any| {
|
||||||
|
public? [ResolvedTo(RAW_FIR)] constructor(): R|test/Base.Nested| {
|
||||||
|
LAZY_super<R|kotlin/Any|>
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final [ResolvedTo(STATUS)] class Child : R|test/Base<kotlin/Any>| {
|
||||||
|
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Child| {
|
||||||
|
super<R|test/Base<kotlin/Any>|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+10
@@ -24,6 +24,16 @@ public class ContextCollectorScriptTestGenerated extends AbstractContextCollecto
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/contextCollector"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/contextCollector"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ClassHeaderPositions {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInClassHeaderPositions() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("analysis/low-level-api-fir/testdata/contextCollector/scripts")
|
@TestMetadata("analysis/low-level-api-fir/testdata/contextCollector/scripts")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
+76
@@ -102,6 +102,82 @@ public class ContextCollectorSourceTestGenerated extends AbstractContextCollecto
|
|||||||
runTest("analysis/low-level-api-fir/testdata/contextCollector/simple.kt");
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class ClassHeaderPositions {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInClassHeaderPositions() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("contextReceiver.kt")
|
||||||
|
public void testContextReceiver() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/contextReceiver.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("primaryConstructorParameter_initializerExpression.kt")
|
||||||
|
public void testPrimaryConstructorParameter_initializerExpression() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/primaryConstructorParameter_initializerExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("primaryConstructorParameter_typeRef.kt")
|
||||||
|
public void testPrimaryConstructorParameter_typeRef() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/primaryConstructorParameter_typeRef.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superTypeCallArgumentsExpression.kt")
|
||||||
|
public void testSuperTypeCallArgumentsExpression() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/superTypeCallArgumentsExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superTypeCallArgumentsTypeRef.kt")
|
||||||
|
public void testSuperTypeCallArgumentsTypeRef() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/superTypeCallArgumentsTypeRef.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superTypeCallee.kt")
|
||||||
|
public void testSuperTypeCallee() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/superTypeCallee.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superTypeCalleeGenerics.kt")
|
||||||
|
public void testSuperTypeCalleeGenerics() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/superTypeCalleeGenerics.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superTypeDelegatedExpression.kt")
|
||||||
|
public void testSuperTypeDelegatedExpression() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/superTypeDelegatedExpression.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superTypeDelegatedTypeRef.kt")
|
||||||
|
public void testSuperTypeDelegatedTypeRef() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/superTypeDelegatedTypeRef.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superTypeRef.kt")
|
||||||
|
public void testSuperTypeRef() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/superTypeRef.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superTypeRefGenerics.kt")
|
||||||
|
public void testSuperTypeRefGenerics() throws Exception {
|
||||||
|
runTest("analysis/low-level-api-fir/testdata/contextCollector/classHeaderPositions/superTypeRefGenerics.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("analysis/low-level-api-fir/testdata/contextCollector/scripts")
|
@TestMetadata("analysis/low-level-api-fir/testdata/contextCollector/scripts")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
Reference in New Issue
Block a user