[Analysis API] Collect designations only for autonomous declarations
Parameters, type parameters, and property accessors are not self-sufficient declarations (their resolution depends on resolution of their parent), so a proper designation path cannot be computed for them. Without a designation path, 'ContextCollector' performs analysis of the whole file, which is inefficient.
This commit is contained in:
+19
-1
@@ -10,6 +10,7 @@ import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirDesignation
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirDesignationWithScript
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.element.builder.getNonLocalContainingOrThisDeclaration
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.element.builder.isAutonomousDeclaration
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.util.ContextCollector.ContextKind
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.util.ContextCollector.Context
|
||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.util.ContextCollector.FilterResponse
|
||||
@@ -36,6 +37,9 @@ import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.fir.types.typeContext
|
||||
import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitorVoid
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.psi.psiUtil.isPropertyParameter
|
||||
import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf
|
||||
import org.jetbrains.kotlin.util.PrivateForInline
|
||||
import org.jetbrains.kotlin.utils.yieldIfNotNull
|
||||
@@ -107,7 +111,7 @@ object ContextCollector {
|
||||
}
|
||||
|
||||
fun computeDesignation(file: FirFile, targetElement: PsiElement): FirDesignation? {
|
||||
val contextKtDeclaration = targetElement.getNonLocalContainingOrThisDeclaration()
|
||||
val contextKtDeclaration = targetElement.getNonLocalContainingOrThisDeclaration(::isValidTarget)
|
||||
if (contextKtDeclaration != null) {
|
||||
val designationPath = FirElementFinder.collectDesignationPath(file, contextKtDeclaration)
|
||||
if (designationPath != null) {
|
||||
@@ -124,6 +128,20 @@ object ContextCollector {
|
||||
return null
|
||||
}
|
||||
|
||||
private fun isValidTarget(declaration: KtDeclaration): Boolean {
|
||||
if (declaration.isAutonomousDeclaration) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (declaration is KtParameter && declaration.isPropertyParameter()) {
|
||||
// Prefer context for primary constructor properties.
|
||||
// Context of the constructor itself can be computed by passing the 'KtPrimaryConstructor' element.
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the [FirFile], collecting contexts for elements matching the [filter].
|
||||
*
|
||||
|
||||
+9
-9
@@ -14,7 +14,7 @@ Tower Data Context:
|
||||
Element 6
|
||||
Scope: FirNestedClassifierScopeWithSubstitution
|
||||
Classifiers:
|
||||
FirRegularClassSymbol public final class Nested : R|kotlin/Any|
|
||||
FirRegularClassSymbol public? final? class Nested : R|kotlin/Any|
|
||||
Static scope owner symbol: FirRegularClassSymbol public open class Base : R|kotlin/Any|
|
||||
Element 7
|
||||
Scope: FirLocalScope
|
||||
@@ -22,20 +22,20 @@ Tower Data Context:
|
||||
FirValueParameterSymbol name: R|kotlin/String| = String(name)
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] primaryConstructorParameter_initializerExpression.kt
|
||||
public open [ResolvedTo(ANNOTATION_ARGUMENTS)] class Base : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Base| {
|
||||
super<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(ANNOTATION_ARGUMENTS)] class Nested : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Base.Nested| {
|
||||
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(BODY_RESOLVE)] val fromBase: R|kotlin/String| = String()
|
||||
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/String|
|
||||
public final [ResolvedTo(STATUS)] val fromBase: R|kotlin/String| = LAZY_EXPRESSION
|
||||
public [ResolvedTo(STATUS)] get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Child : R|test/Base| {
|
||||
|
||||
+7
-7
@@ -14,7 +14,7 @@ Tower Data Context:
|
||||
Element 6
|
||||
Scope: FirNestedClassifierScopeWithSubstitution
|
||||
Classifiers:
|
||||
FirRegularClassSymbol public final class Nested : R|kotlin/Any|
|
||||
FirRegularClassSymbol public? final? class Nested : R|kotlin/Any|
|
||||
Static scope owner symbol: FirRegularClassSymbol public open class Base : R|kotlin/Any|
|
||||
Element 7
|
||||
Scope: FirLocalScope
|
||||
@@ -22,14 +22,14 @@ Tower Data Context:
|
||||
FirValueParameterSymbol name: R|kotlin/String|
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] primaryConstructorParameter_typeRef.kt
|
||||
public open [ResolvedTo(ANNOTATION_ARGUMENTS)] class Base : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Base| {
|
||||
super<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(ANNOTATION_ARGUMENTS)] class Nested : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Base.Nested| {
|
||||
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|>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class Foo {
|
||||
fun foo(<expr>abc: Int</expr>) {}
|
||||
fun other() {}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
Tower Data Context:
|
||||
Element 0
|
||||
Scope: FirDefaultStarImportingScope
|
||||
Element 1
|
||||
Scope: FirExplicitStarImportingScope
|
||||
Element 2
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 3
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 4
|
||||
Scope: FirPackageMemberScope
|
||||
Element 5
|
||||
Scope: FirExplicitSimpleImportingScope
|
||||
Element 6
|
||||
Implicit receiver:
|
||||
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
|
||||
Type: Foo
|
||||
Element 7
|
||||
Scope: FirLocalScope
|
||||
Properties:
|
||||
FirValueParameterSymbol abc: R|kotlin/Int|
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] parameter.kt
|
||||
public final [ResolvedTo(STATUS)] class Foo : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] constructor(): R|Foo| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] abc: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final [ResolvedTo(STATUS)] fun other(): R|kotlin/Unit| { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Foo<expr>(
|
||||
val a: String = "foo"
|
||||
val b: Int = a.length
|
||||
)</expr>
|
||||
@@ -0,0 +1,31 @@
|
||||
Tower Data Context:
|
||||
Element 0
|
||||
Scope: FirDefaultStarImportingScope
|
||||
Element 1
|
||||
Scope: FirExplicitStarImportingScope
|
||||
Element 2
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 3
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 4
|
||||
Scope: FirPackageMemberScope
|
||||
Element 5
|
||||
Scope: FirExplicitSimpleImportingScope
|
||||
Element 6
|
||||
Implicit receiver:
|
||||
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
|
||||
Type: Foo
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] primaryConstructor.kt
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Foo : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] a: R|kotlin/String| = String(foo), [ResolvedTo(BODY_RESOLVE)] b: R|kotlin/Int| = R|<local>/a|.R|kotlin/String.length|): R|Foo| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [ResolvedTo(STATUS)] val a: R|kotlin/String| = R|<local>/a|
|
||||
public [ResolvedTo(STATUS)] get(): R|kotlin/String|
|
||||
|
||||
public final [ResolvedTo(STATUS)] val b: R|kotlin/Int| = R|<local>/b|
|
||||
public [ResolvedTo(STATUS)] get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
class Foo(
|
||||
val a: String = "foo"
|
||||
val b: Int = <expr>a.length</expr>,
|
||||
val c: Long = (a.length - 1).toLong()
|
||||
a: String = "foo",
|
||||
b: Int = <expr>a.length</expr>,
|
||||
c: Long = (a.length - 1).toLong()
|
||||
)
|
||||
+7
-14
@@ -12,23 +12,16 @@ Tower Data Context:
|
||||
Element 5
|
||||
Scope: FirExplicitSimpleImportingScope
|
||||
Element 6
|
||||
Implicit receiver:
|
||||
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
|
||||
Type: Foo
|
||||
Scope: FirLocalScope
|
||||
Properties:
|
||||
FirValueParameterSymbol a: R|kotlin/String| = String(foo)
|
||||
FirValueParameterSymbol b: R|kotlin/Int| = R|<local>/a|.R|kotlin/String.length|
|
||||
FirValueParameterSymbol c: R|kotlin/Long| = R|<local>/a|.R|kotlin/String.length|.R|kotlin/Int.minus|(Int(1)).R|kotlin/Int.toLong|()
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] primaryConstructorParameter.kt
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Foo : R|kotlin/Any| {
|
||||
public [ResolvedTo(ANNOTATION_ARGUMENTS)] constructor([ResolvedTo(ANNOTATION_ARGUMENTS)] a: R|kotlin/String| = LAZY_EXPRESSION, [ResolvedTo(ANNOTATION_ARGUMENTS)] b: R|kotlin/Int| = LAZY_EXPRESSION, [ResolvedTo(ANNOTATION_ARGUMENTS)] c: R|kotlin/Long| = LAZY_EXPRESSION): R|Foo| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor([ResolvedTo(BODY_RESOLVE)] a: R|kotlin/String| = String(foo), [ResolvedTo(BODY_RESOLVE)] b: R|kotlin/Int| = R|<local>/a|.R|kotlin/String.length|, [ResolvedTo(BODY_RESOLVE)] c: R|kotlin/Long| = R|<local>/a|.R|kotlin/String.length|.R|kotlin/Int.minus|(Int(1)).R|kotlin/Int.toLong|()): R|Foo| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final [ResolvedTo(STATUS)] val a: R|kotlin/String| = R|<local>/a|
|
||||
public [ResolvedTo(STATUS)] get(): R|kotlin/String|
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] val b: R|kotlin/Int| = R|<local>/b|
|
||||
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
|
||||
|
||||
public final [ResolvedTo(STATUS)] val c: R|kotlin/Long| = R|<local>/c|
|
||||
public [ResolvedTo(STATUS)] get(): R|kotlin/Long|
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Foo(
|
||||
val a: String = "foo"
|
||||
val b: Int = <expr>a.length</expr>,
|
||||
val c: Long = (a.length - 1).toLong()
|
||||
)
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
Tower Data Context:
|
||||
Element 0
|
||||
Scope: FirDefaultStarImportingScope
|
||||
Element 1
|
||||
Scope: FirExplicitStarImportingScope
|
||||
Element 2
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 3
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 4
|
||||
Scope: FirPackageMemberScope
|
||||
Element 5
|
||||
Scope: FirExplicitSimpleImportingScope
|
||||
Element 6
|
||||
Implicit receiver:
|
||||
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
|
||||
Type: Foo
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] primaryConstructorProperty.kt
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Foo : R|kotlin/Any| {
|
||||
public [ResolvedTo(ANNOTATION_ARGUMENTS)] constructor([ResolvedTo(ANNOTATION_ARGUMENTS)] a: R|kotlin/String| = LAZY_EXPRESSION, [ResolvedTo(ANNOTATION_ARGUMENTS)] b: R|kotlin/Int| = LAZY_EXPRESSION, [ResolvedTo(ANNOTATION_ARGUMENTS)] c: R|kotlin/Long| = LAZY_EXPRESSION): R|Foo| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final [ResolvedTo(STATUS)] val a: R|kotlin/String| = R|<local>/a|
|
||||
public [ResolvedTo(STATUS)] get(): R|kotlin/String|
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] val b: R|kotlin/Int| = R|<local>/b|
|
||||
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
|
||||
|
||||
public final [ResolvedTo(STATUS)] val c: R|kotlin/Long| = R|<local>/c|
|
||||
public [ResolvedTo(STATUS)] get(): R|kotlin/Long|
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Foo {
|
||||
val x: Int
|
||||
<expr>get() = 42</expr>
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
Tower Data Context:
|
||||
Element 0
|
||||
Scope: FirDefaultStarImportingScope
|
||||
Element 1
|
||||
Scope: FirExplicitStarImportingScope
|
||||
Element 2
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 3
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 4
|
||||
Scope: FirPackageMemberScope
|
||||
Element 5
|
||||
Scope: FirExplicitSimpleImportingScope
|
||||
Element 6
|
||||
Implicit receiver:
|
||||
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
|
||||
Type: Foo
|
||||
Element 7
|
||||
Scope: FirLocalScope
|
||||
Properties:
|
||||
FirBackingFieldSymbol private <explicit backing field>: R|kotlin/Int|
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] propertyAccessor.kt
|
||||
public final [ResolvedTo(STATUS)] class Foo : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] constructor(): R|Foo| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] val x: R|kotlin/Int|
|
||||
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int| {
|
||||
^ Int(42)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Foo {
|
||||
fun <<expr>T</expr>> foo(obj: T) {}
|
||||
fun other() {}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
Tower Data Context:
|
||||
Element 0
|
||||
Scope: FirDefaultStarImportingScope
|
||||
Element 1
|
||||
Scope: FirExplicitStarImportingScope
|
||||
Element 2
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 3
|
||||
Scope: FirDefaultSimpleImportingScope
|
||||
Element 4
|
||||
Scope: FirPackageMemberScope
|
||||
Element 5
|
||||
Scope: FirExplicitSimpleImportingScope
|
||||
Element 6
|
||||
Implicit receiver:
|
||||
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
|
||||
Type: Foo
|
||||
Element 7
|
||||
Scope: FirMemberTypeParameterScope
|
||||
Classifiers:
|
||||
FirTypeParameterSymbol T
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] typeParameter.kt
|
||||
public final [ResolvedTo(STATUS)] class Foo : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] constructor(): R|Foo| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun <[ResolvedTo(BODY_RESOLVE)] T> foo([ResolvedTo(BODY_RESOLVE)] obj: R|T|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final [ResolvedTo(STATUS)] fun other(): R|kotlin/Unit| { LAZY_BLOCK }
|
||||
|
||||
}
|
||||
+4
-4
@@ -29,12 +29,12 @@ Tower Data Context:
|
||||
FirTypeParameterSymbol T : R|MyParam|
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] declaredInClass_fromInner_typeBound.kt
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Outer<[ResolvedTo(ANNOTATION_ARGUMENTS)] MyParam> : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor<[ResolvedTo(ANNOTATION_ARGUMENTS)] MyParam>(): R|test/Outer<MyParam>| {
|
||||
super<R|kotlin/Any|>()
|
||||
public final [ResolvedTo(STATUS)] class Outer<[ResolvedTo(STATUS)] MyParam> : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] constructor<[ResolvedTo(STATUS)] MyParam>(): R|test/Outer<MyParam>| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final inner [ResolvedTo(ANNOTATION_ARGUMENTS)] class Inner<[ResolvedTo(ANNOTATION_ARGUMENTS)] T : R|MyParam|, [ResolvedTo(ANNOTATION_ARGUMENTS)] Outer(MyParam)> : R|kotlin/Any| {
|
||||
public final inner [ResolvedTo(ANNOTATION_ARGUMENTS)] class Inner<[ResolvedTo(ANNOTATION_ARGUMENTS)] T : R|MyParam|, [ResolvedTo(STATUS)] Outer(MyParam)> : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] test/Outer<MyParam>.constructor<[ResolvedTo(ANNOTATION_ARGUMENTS)] T : R|MyParam|>(): R|test/Outer.Inner<T, MyParam>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+6
-6
@@ -35,14 +35,14 @@ Tower Data Context:
|
||||
FirValueParameterSymbol p: R|MyParam|
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] declaredInClass_fromInner_typeRefInMember.kt
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Outer<[ResolvedTo(ANNOTATION_ARGUMENTS)] MyParam> : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor<[ResolvedTo(ANNOTATION_ARGUMENTS)] MyParam>(): R|test/Outer<MyParam>| {
|
||||
super<R|kotlin/Any|>()
|
||||
public final [ResolvedTo(STATUS)] class Outer<[ResolvedTo(STATUS)] MyParam> : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] constructor<[ResolvedTo(STATUS)] MyParam>(): R|test/Outer<MyParam>| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final inner [ResolvedTo(ANNOTATION_ARGUMENTS)] class Inner<[ResolvedTo(ANNOTATION_ARGUMENTS)] Outer(MyParam)> : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] test/Outer<MyParam>.constructor(): R|test/Outer.Inner<MyParam>| {
|
||||
super<R|kotlin/Any|>()
|
||||
public final inner [ResolvedTo(STATUS)] class Inner<[ResolvedTo(STATUS)] Outer(MyParam)> : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] test/Outer<MyParam>.constructor(): R|test/Outer.Inner<MyParam>| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun member([ResolvedTo(BODY_RESOLVE)] p: R|MyParam|): R|kotlin/Unit| {
|
||||
|
||||
+3
-3
@@ -29,9 +29,9 @@ Tower Data Context:
|
||||
FirTypeParameterSymbol T : <ERROR TYPE REF: Symbol not found for MyParam>
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] declaredInClass_fromNested_typeBound.kt
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Outer<[ResolvedTo(ANNOTATION_ARGUMENTS)] MyParam> : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor<[ResolvedTo(ANNOTATION_ARGUMENTS)] MyParam>(): R|test/Outer<MyParam>| {
|
||||
super<R|kotlin/Any|>()
|
||||
public final [ResolvedTo(STATUS)] class Outer<[ResolvedTo(STATUS)] MyParam> : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] constructor<[ResolvedTo(STATUS)] MyParam>(): R|test/Outer<MyParam>| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Nested<[ResolvedTo(ANNOTATION_ARGUMENTS)] T : <ERROR TYPE REF: Symbol not found for MyParam>> : R|kotlin/Any| {
|
||||
|
||||
+6
-6
@@ -25,14 +25,14 @@ Tower Data Context:
|
||||
FirValueParameterSymbol p: <ERROR TYPE REF: Symbol not found for MyParam>
|
||||
|
||||
FILE: [ResolvedTo(IMPORTS)] declaredInClass_fromNested_typeRefInMember.kt
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Outer<[ResolvedTo(ANNOTATION_ARGUMENTS)] MyParam> : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor<[ResolvedTo(ANNOTATION_ARGUMENTS)] MyParam>(): R|test/Outer<MyParam>| {
|
||||
super<R|kotlin/Any|>()
|
||||
public final [ResolvedTo(STATUS)] class Outer<[ResolvedTo(STATUS)] MyParam> : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] constructor<[ResolvedTo(STATUS)] MyParam>(): R|test/Outer<MyParam>| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class Nested : R|kotlin/Any| {
|
||||
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|test/Outer.Nested| {
|
||||
super<R|kotlin/Any|>()
|
||||
public final [ResolvedTo(STATUS)] class Nested : R|kotlin/Any| {
|
||||
public [ResolvedTo(STATUS)] constructor(): R|test/Outer.Nested| {
|
||||
LAZY_super<R|kotlin/Any|>
|
||||
}
|
||||
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun member([ResolvedTo(BODY_RESOLVE)] p: <ERROR TYPE REF: Symbol not found for MyParam>): R|kotlin/Unit| {
|
||||
|
||||
+30
@@ -96,12 +96,36 @@ public class ContextCollectorSourceTestGenerated extends AbstractContextCollecto
|
||||
runTest("analysis/low-level-api-fir/testData/contextCollector/nestedClasses.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("parameter.kt")
|
||||
public void testParameter() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testData/contextCollector/parameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primaryConstructor.kt")
|
||||
public void testPrimaryConstructor() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testData/contextCollector/primaryConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primaryConstructorParameter.kt")
|
||||
public void testPrimaryConstructorParameter() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testData/contextCollector/primaryConstructorParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primaryConstructorProperty.kt")
|
||||
public void testPrimaryConstructorProperty() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testData/contextCollector/primaryConstructorProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyAccessor.kt")
|
||||
public void testPropertyAccessor() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testData/contextCollector/propertyAccessor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyDelegateInitializer.kt")
|
||||
public void testPropertyDelegateInitializer() throws Exception {
|
||||
@@ -114,6 +138,12 @@ public class ContextCollectorSourceTestGenerated extends AbstractContextCollecto
|
||||
runTest("analysis/low-level-api-fir/testData/contextCollector/simple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeParameter.kt")
|
||||
public void testTypeParameter() throws Exception {
|
||||
runTest("analysis/low-level-api-fir/testData/contextCollector/typeParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("wholeDeclaration_class.kt")
|
||||
public void testWholeDeclaration_class() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user