[Analysis API] Add more ContextCollector tests inspired by dependentCopy

As the on-air analysis is obsolete, related tests are going to be
deleted. Here we add cases not yet covered by 'ContextCollector' tests.
This commit is contained in:
Yan Zhulanow
2024-01-11 17:34:34 +09:00
committed by Space Team
parent 0502da474b
commit 08727bf0be
23 changed files with 966 additions and 0 deletions
@@ -0,0 +1,56 @@
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
Scope: FirScriptDeclarationsScope
Classifiers:
FirRegularClassSymbol public final? class Foo : R|kotlin/Any|
Element 7
Scope: FirLocalScope
Classifiers:
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
Properties:
FirPropertySymbol lval args: R|kotlin/Array<kotlin/String>|
Element 8
Context receivers:
FirScriptSymbol context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: <script-insideClassBody.kts>
lval args: R|kotlin/Array<kotlin/String>|
public final? class Foo : R|kotlin/Any|
Type: kotlin.script.templates.standard.ScriptTemplateWithArgs
Label: <script>
Element 9
Implicit receiver:
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
Type: Foo
Element 10
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] insideClassBody.kts
context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: [ResolvedTo(TYPES)] <script-insideClassBody.kts>
[ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array<kotlin/String>|
public final? [ResolvedTo(RAW_FIR)] class Foo : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] constructor(): R|Foo| {
LAZY_super<R|kotlin/Any|>
}
public? final? [ResolvedTo(RAW_FIR)] val x: <implicit> = LAZY_EXPRESSION
public? [ResolvedTo(RAW_FIR)] get(): <implicit>
public final [ResolvedTo(BODY_RESOLVE)] fun foo(): R|kotlin/Unit| {
}
}
@@ -0,0 +1,5 @@
class Foo {
val x = 0
<expr>fun foo() {}</expr>
}
@@ -0,0 +1,56 @@
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
Scope: FirScriptDeclarationsScope
Classifiers:
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
Element 7
Scope: FirLocalScope
Classifiers:
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
Properties:
FirPropertySymbol lval args: R|kotlin/Array<kotlin/String>|
Element 8
Context receivers:
FirScriptSymbol context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: <script-insideClassBody.kts>
lval args: R|kotlin/Array<kotlin/String>|
public final class Foo : R|kotlin/Any|
Type: kotlin.script.templates.standard.ScriptTemplateWithArgs
Label: <script>
Element 9
Implicit receiver:
FirRegularClassSymbol public final class Foo : R|kotlin/Any|
Type: Foo
Element 10
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] insideClassBody.kts
context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: [ResolvedTo(TYPES)] <script-insideClassBody.kts>
[ResolvedTo(RAW_FIR)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(STATUS)] class Foo : R|kotlin/Any| {
public [ResolvedTo(STATUS)] constructor(): R|Foo| {
LAZY_super<R|kotlin/Any|>
}
public final [ResolvedTo(STATUS)] val x: <implicit> = LAZY_EXPRESSION
public [ResolvedTo(STATUS)] get(): <implicit>
public final [ResolvedTo(BODY_RESOLVE)] fun foo(): R|kotlin/Unit| {
}
}
@@ -0,0 +1,86 @@
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
Scope: FirScriptDeclarationsScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Element 7
Scope: FirLocalScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol lval args: R|kotlin/Array<kotlin/String>|
Element 8
Context receivers:
FirScriptSymbol context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: <script-lastStatement.kts>
lval args: R|kotlin/Array<kotlin/String>|
public final class ScriptClass : R|kotlin/Any|
public final fun scriptFunction(): R|kotlin/Int|
public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
init
public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Type: kotlin.script.templates.standard.ScriptTemplateWithArgs
Label: <script>
FILE: [ResolvedTo(IMPORTS)] lastStatement.kts
context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: [ResolvedTo(BODY_RESOLVE)] <script-lastStatement.kts>
[ResolvedTo(BODY_RESOLVE)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(STATUS)] class ScriptClass : R|kotlin/Any| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|ScriptClass| {
super<R|kotlin/Any|>()
}
public final [ResolvedTo(BODY_RESOLVE)] val memberProperty: R|kotlin/Int| = Int(4)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
}
public final [ResolvedTo(BODY_RESOLVE)] fun scriptFunction(): R|kotlin/Int| {
^scriptFunction Int(42)
}
public final [ResolvedTo(BODY_RESOLVE)] fun unusedScriptFunction([ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|): R|kotlin/Int| {
^unusedScriptFunction Int(22)
}
[ResolvedTo(BODY_RESOLVE)] init {
R|/scriptFunction|()
}
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|, [ResolvedTo(BODY_RESOLVE)] action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit| {
R|<local>/action|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/i|)
}
public final [ResolvedTo(BODY_RESOLVE)] val $$result: R|kotlin/Unit| = R|/foo|(R|/scriptFunction|(), <L> = [ResolvedTo(BODY_RESOLVE)] foo@fun <anonymous>([ResolvedTo(BODY_RESOLVE)] it: R|kotlin/Int|): R|kotlin/Unit| <inline=NoInline> {
R|/scriptFunction|()
}
)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Unit|
@@ -0,0 +1,16 @@
class ScriptClass {
val memberProperty = 4
}
fun scriptFunction() = 42
fun unusedScriptFunction(p: String) = 22
scriptFunction()
fun foo(i: Int, action: (Int) -> Unit) {
action(i)
}
<expr>foo(scriptFunction()) {
scriptFunction()
}</expr>
@@ -0,0 +1,86 @@
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
Scope: FirScriptDeclarationsScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Element 7
Scope: FirLocalScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol lval args: R|kotlin/Array<kotlin/String>|
Element 8
Context receivers:
FirScriptSymbol context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: <script-lastStatement.kts>
lval args: R|kotlin/Array<kotlin/String>|
public final class ScriptClass : R|kotlin/Any|
public final fun scriptFunction(): R|kotlin/Int|
public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
init
public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Type: kotlin.script.templates.standard.ScriptTemplateWithArgs
Label: <script>
FILE: [ResolvedTo(IMPORTS)] lastStatement.kts
context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: [ResolvedTo(BODY_RESOLVE)] <script-lastStatement.kts>
[ResolvedTo(BODY_RESOLVE)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class ScriptClass : R|kotlin/Any| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|ScriptClass| {
super<R|kotlin/Any|>()
}
public final [ResolvedTo(BODY_RESOLVE)] val memberProperty: R|kotlin/Int| = Int(4)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
}
public final [ResolvedTo(BODY_RESOLVE)] fun scriptFunction(): R|kotlin/Int| {
^scriptFunction Int(42)
}
public final [ResolvedTo(BODY_RESOLVE)] fun unusedScriptFunction([ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|): R|kotlin/Int| {
^unusedScriptFunction Int(22)
}
[ResolvedTo(BODY_RESOLVE)] init {
R|/scriptFunction|()
}
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|, [ResolvedTo(BODY_RESOLVE)] action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit| {
R|<local>/action|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/i|)
}
public final [ResolvedTo(BODY_RESOLVE)] val $$result: R|kotlin/Unit| = R|/foo|(R|/scriptFunction|(), <L> = [ResolvedTo(BODY_RESOLVE)] foo@fun <anonymous>([ResolvedTo(BODY_RESOLVE)] it: R|kotlin/Int|): R|kotlin/Unit| <inline=NoInline> {
R|/scriptFunction|()
}
)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Unit|
@@ -0,0 +1,92 @@
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
Scope: FirScriptDeclarationsScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Element 7
Scope: FirLocalScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol lval args: R|kotlin/Array<kotlin/String>|
Element 8
Context receivers:
FirScriptSymbol context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: <script-scriptInsideLastStatement.kts>
lval args: R|kotlin/Array<kotlin/String>|
public final class ScriptClass : R|kotlin/Any|
public final fun scriptFunction(): R|kotlin/Int|
public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
init
public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Type: kotlin.script.templates.standard.ScriptTemplateWithArgs
Label: <script>
Element 9
Scope: FirLocalScope
Properties:
FirValueParameterSymbol it: R|kotlin/Int|
Element 10
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] scriptInsideLastStatement.kts
context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: [ResolvedTo(BODY_RESOLVE)] <script-scriptInsideLastStatement.kts>
[ResolvedTo(BODY_RESOLVE)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(STATUS)] class ScriptClass : R|kotlin/Any| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|ScriptClass| {
super<R|kotlin/Any|>()
}
public final [ResolvedTo(BODY_RESOLVE)] val memberProperty: R|kotlin/Int| = Int(4)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
}
public final [ResolvedTo(BODY_RESOLVE)] fun scriptFunction(): R|kotlin/Int| {
^scriptFunction Int(42)
}
public final [ResolvedTo(BODY_RESOLVE)] fun unusedScriptFunction([ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|): R|kotlin/Int| {
^unusedScriptFunction Int(22)
}
[ResolvedTo(BODY_RESOLVE)] init {
R|/scriptFunction|()
}
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|, [ResolvedTo(BODY_RESOLVE)] action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit| {
R|<local>/action|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/i|)
}
public final [ResolvedTo(BODY_RESOLVE)] val $$result: R|kotlin/Unit| = R|/foo|(R|/scriptFunction|(), <L> = [ResolvedTo(BODY_RESOLVE)] foo@fun <anonymous>([ResolvedTo(BODY_RESOLVE)] it: R|kotlin/Int|): R|kotlin/Unit| <inline=NoInline> {
R|/scriptFunction|()
}
)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Unit|
@@ -0,0 +1,16 @@
class ScriptClass {
val memberProperty = 4
}
fun scriptFunction() = 42
fun unusedScriptFunction(p: String) = 22
scriptFunction()
fun foo(i: Int, action: (Int) -> Unit) {
action(i)
}
foo(scriptFunction()) {
<expr>scriptFunction()</expr>
}
@@ -0,0 +1,92 @@
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
Scope: FirScriptDeclarationsScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Element 7
Scope: FirLocalScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol lval args: R|kotlin/Array<kotlin/String>|
Element 8
Context receivers:
FirScriptSymbol context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: <script-scriptInsideLastStatement.kts>
lval args: R|kotlin/Array<kotlin/String>|
public final class ScriptClass : R|kotlin/Any|
public final fun scriptFunction(): R|kotlin/Int|
public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
init
public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Type: kotlin.script.templates.standard.ScriptTemplateWithArgs
Label: <script>
Element 9
Scope: FirLocalScope
Properties:
FirValueParameterSymbol it: R|kotlin/Int|
Element 10
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] scriptInsideLastStatement.kts
context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: [ResolvedTo(BODY_RESOLVE)] <script-scriptInsideLastStatement.kts>
[ResolvedTo(BODY_RESOLVE)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class ScriptClass : R|kotlin/Any| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|ScriptClass| {
super<R|kotlin/Any|>()
}
public final [ResolvedTo(BODY_RESOLVE)] val memberProperty: R|kotlin/Int| = Int(4)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
}
public final [ResolvedTo(BODY_RESOLVE)] fun scriptFunction(): R|kotlin/Int| {
^scriptFunction Int(42)
}
public final [ResolvedTo(BODY_RESOLVE)] fun unusedScriptFunction([ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|): R|kotlin/Int| {
^unusedScriptFunction Int(22)
}
[ResolvedTo(BODY_RESOLVE)] init {
R|/scriptFunction|()
}
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|, [ResolvedTo(BODY_RESOLVE)] action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit| {
R|<local>/action|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/i|)
}
public final [ResolvedTo(BODY_RESOLVE)] val $$result: R|kotlin/Unit| = R|/foo|(R|/scriptFunction|(), <L> = [ResolvedTo(BODY_RESOLVE)] foo@fun <anonymous>([ResolvedTo(BODY_RESOLVE)] it: R|kotlin/Int|): R|kotlin/Unit| <inline=NoInline> {
R|/scriptFunction|()
}
)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Unit|
@@ -0,0 +1,89 @@
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
Scope: FirScriptDeclarationsScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Element 7
Scope: FirLocalScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol lval args: R|kotlin/Array<kotlin/String>|
Element 8
Context receivers:
FirScriptSymbol context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: <script-statement.kts>
lval args: R|kotlin/Array<kotlin/String>|
public final class ScriptClass : R|kotlin/Any|
public final fun scriptFunction(): R|kotlin/Int|
public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
init
public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Type: kotlin.script.templates.standard.ScriptTemplateWithArgs
Label: <script>
Element 9
Scope: FirLocalScope
Element 10
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] statement.kts
context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: [ResolvedTo(BODY_RESOLVE)] <script-statement.kts>
[ResolvedTo(BODY_RESOLVE)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(STATUS)] class ScriptClass : R|kotlin/Any| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|ScriptClass| {
super<R|kotlin/Any|>()
}
public final [ResolvedTo(BODY_RESOLVE)] val memberProperty: R|kotlin/Int| = Int(4)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
}
public final [ResolvedTo(BODY_RESOLVE)] fun scriptFunction(): R|kotlin/Int| {
^scriptFunction Int(42)
}
public final [ResolvedTo(BODY_RESOLVE)] fun unusedScriptFunction([ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|): R|kotlin/Int| {
^unusedScriptFunction Int(22)
}
[ResolvedTo(BODY_RESOLVE)] init {
R|/scriptFunction|()
}
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|, [ResolvedTo(BODY_RESOLVE)] action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit| {
R|<local>/action|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/i|)
}
public final [ResolvedTo(BODY_RESOLVE)] val $$result: R|kotlin/Unit| = R|/foo|(R|/scriptFunction|(), <L> = [ResolvedTo(BODY_RESOLVE)] foo@fun <anonymous>([ResolvedTo(BODY_RESOLVE)] it: R|kotlin/Int|): R|kotlin/Unit| <inline=NoInline> {
R|/scriptFunction|()
}
)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Unit|
@@ -0,0 +1,16 @@
class ScriptClass {
val memberProperty = 4
}
fun scriptFunction() = 42
fun unusedScriptFunction(p: String) = 22
<expr>scriptFunction()</expr>
fun foo(i: Int, action: (Int) -> Unit) {
action(i)
}
foo(scriptFunction()) {
scriptFunction()
}
@@ -0,0 +1,89 @@
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
Scope: FirScriptDeclarationsScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Element 7
Scope: FirLocalScope
Classifiers:
FirRegularClassSymbol public final class ScriptClass : R|kotlin/Any|
Functions
FirNamedFunctionSymbol public final fun scriptFunction(): R|kotlin/Int|
FirNamedFunctionSymbol public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
Properties:
FirPropertySymbol lval args: R|kotlin/Array<kotlin/String>|
Element 8
Context receivers:
FirScriptSymbol context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: <script-statement.kts>
lval args: R|kotlin/Array<kotlin/String>|
public final class ScriptClass : R|kotlin/Any|
public final fun scriptFunction(): R|kotlin/Int|
public final fun unusedScriptFunction(p: R|kotlin/String|): R|kotlin/Int|
init
public final fun foo(i: R|kotlin/Int|, action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit|
public final val $$result: R|kotlin/Unit|
public get(): R|kotlin/Unit|
Type: kotlin.script.templates.standard.ScriptTemplateWithArgs
Label: <script>
Element 9
Scope: FirLocalScope
Element 10
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] statement.kts
context(<script>@R|kotlin/script/templates/standard/ScriptTemplateWithArgs|)
SCRIPT: [ResolvedTo(BODY_RESOLVE)] <script-statement.kts>
[ResolvedTo(BODY_RESOLVE)] lval args: R|kotlin/Array<kotlin/String>|
public final [ResolvedTo(ANNOTATION_ARGUMENTS)] class ScriptClass : R|kotlin/Any| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|ScriptClass| {
super<R|kotlin/Any|>()
}
public final [ResolvedTo(BODY_RESOLVE)] val memberProperty: R|kotlin/Int| = Int(4)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Int|
}
public final [ResolvedTo(BODY_RESOLVE)] fun scriptFunction(): R|kotlin/Int| {
^scriptFunction Int(42)
}
public final [ResolvedTo(BODY_RESOLVE)] fun unusedScriptFunction([ResolvedTo(BODY_RESOLVE)] p: R|kotlin/String|): R|kotlin/Int| {
^unusedScriptFunction Int(22)
}
[ResolvedTo(BODY_RESOLVE)] init {
R|/scriptFunction|()
}
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|, [ResolvedTo(BODY_RESOLVE)] action: R|(kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit| {
R|<local>/action|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/i|)
}
public final [ResolvedTo(BODY_RESOLVE)] val $$result: R|kotlin/Unit| = R|/foo|(R|/scriptFunction|(), <L> = [ResolvedTo(BODY_RESOLVE)] foo@fun <anonymous>([ResolvedTo(BODY_RESOLVE)] it: R|kotlin/Int|): R|kotlin/Unit| <inline=NoInline> {
R|/scriptFunction|()
}
)
public [ResolvedTo(BODY_RESOLVE)] get(): R|kotlin/Unit|