[LL FIR] rename testdata to testData to avoid copyright generation

We exclude testData pattern from copyright scope
This commit is contained in:
Dmitrii Gridin
2023-09-18 19:33:14 +02:00
committed by Space Team
parent aef5290210
commit 33e6a85a2d
1953 changed files with 2000 additions and 2000 deletions
@@ -0,0 +1,10 @@
interface Foo {}
fun test(obj: Any) {
if (obj is Foo) {
consume(obj)
}
<expr>obj.hashCode()</expr>
}
fun consume(obj: Foo) {}
@@ -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
Element 7
Scope: FirLocalScope
Properties:
FirValueParameterSymbol obj: R|kotlin/Any|
Element 8
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] afterIf.kt
public abstract [ResolvedTo(STATUS)] interface Foo : R|kotlin/Any| {
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] obj: R|kotlin/Any|): R|kotlin/Unit| {
when () {
(R|<local>/obj| is R|Foo|) -> {
R|/consume|(R|<local>/obj|)
}
}
R|<local>/obj|.R|kotlin/Any.hashCode|()
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] obj: R|Foo|): R|kotlin/Unit| {
}
@@ -0,0 +1,17 @@
interface Node {
val shouldProcess: Boolean
val parent: Node?
}
fun test(initial: Node?) {
var current = initial
while (current!!.shouldProcess) {
consume(current)
current = current.parent
}
<expr>consume(current)</expr>
}
fun consume(node: Node) {}
@@ -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: FirLocalScope
Properties:
FirValueParameterSymbol initial: R|Node?|
Element 8
Scope: FirLocalScope
Properties:
FirPropertySymbol lvar current: R|Node?|
Smart Casts:
FirPropertySymbol lvar current: R|Node?|
Types:
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] afterLoop.kt
public abstract [ResolvedTo(STATUS)] interface Node : R|kotlin/Any| {
public abstract [ResolvedTo(CONTRACTS)] val shouldProcess: R|kotlin/Boolean|
public [ResolvedTo(CONTRACTS)] get(): R|kotlin/Boolean|
public abstract [ResolvedTo(CONTRACTS)] val parent: R|Node?|
public [ResolvedTo(CONTRACTS)] get(): R|Node?|
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] initial: R|Node?|): R|kotlin/Unit| {
[ResolvedTo(BODY_RESOLVE)] lvar current: R|Node?| = R|<local>/initial|
while(R|<local>/current|!!.R|/Node.shouldProcess|) {
R|/consume|(R|<local>/current|)
R|<local>/current| = R|<local>/current|.R|/Node.parent|
}
R|/consume|(R|<local>/current|)
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] node: R|Node|): R|kotlin/Unit| {
}
@@ -0,0 +1,11 @@
interface Foo {
val isValid: Boolean
}
fun test(obj: Any) {
if (obj is Foo && <expr>obj.isValid</expr>) {
consume(obj)
}
}
fun consume(obj: Foo) {}
@@ -0,0 +1,43 @@
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: FirLocalScope
Properties:
FirValueParameterSymbol obj: R|kotlin/Any|
Element 8
Scope: FirLocalScope
Smart Casts:
FirValueParameterSymbol obj: R|kotlin/Any|
Types:
Foo
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] andRight.kt
public abstract [ResolvedTo(STATUS)] interface Foo : R|kotlin/Any| {
public abstract [ResolvedTo(CONTRACTS)] val isValid: R|kotlin/Boolean|
public [ResolvedTo(CONTRACTS)] get(): R|kotlin/Boolean|
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] obj: R|kotlin/Any|): R|kotlin/Unit| {
when () {
(R|<local>/obj| is R|Foo|) && R|<local>/obj|.R|/Foo.isValid| -> {
R|/consume|(R|<local>/obj|)
}
}
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] obj: R|Foo|): R|kotlin/Unit| {
}
@@ -0,0 +1,9 @@
interface Foo {}
fun test(obj: Any) {
if (obj is Foo) {
<expr>consume(obj)</expr>
}
}
fun consume(obj: Foo) {}
@@ -0,0 +1,42 @@
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: FirLocalScope
Properties:
FirValueParameterSymbol obj: R|kotlin/Any|
Element 8
Scope: FirLocalScope
Element 9
Scope: FirLocalScope
Smart Casts:
FirValueParameterSymbol obj: R|kotlin/Any|
Types:
Foo
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] argument.kt
public abstract [ResolvedTo(STATUS)] interface Foo : R|kotlin/Any| {
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] obj: R|kotlin/Any|): R|kotlin/Unit| {
when () {
(R|<local>/obj| is R|Foo|) -> {
R|/consume|(R|<local>/obj|)
}
}
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] obj: R|Foo|): R|kotlin/Unit| {
}
@@ -0,0 +1,12 @@
interface Foo {}
interface Bar {}
fun test(obj: Any) {
if (obj is Foo) {
if (obj is Bar) {
<expr>obj.consume(obj)</expr>
}
}
}
fun Bar.consume(obj: Foo) {}
@@ -0,0 +1,52 @@
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: FirLocalScope
Properties:
FirValueParameterSymbol obj: R|kotlin/Any|
Element 8
Scope: FirLocalScope
Element 9
Scope: FirLocalScope
Element 10
Scope: FirLocalScope
Smart Casts:
FirValueParameterSymbol obj: R|kotlin/Any|
Types:
Foo
kotlin/Any
Bar
FILE: [ResolvedTo(IMPORTS)] argumentAsReceiver.kt
public abstract [ResolvedTo(STATUS)] interface Foo : R|kotlin/Any| {
}
public abstract [ResolvedTo(STATUS)] interface Bar : R|kotlin/Any| {
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] obj: R|kotlin/Any|): R|kotlin/Unit| {
when () {
(R|<local>/obj| is R|Foo|) -> {
when () {
(R|<local>/obj| is R|Bar|) -> {
R|<local>/obj|.R|/consume|(R|<local>/obj|)
}
}
}
}
}
public final [ResolvedTo(CONTRACTS)] fun R|Bar|.consume([ResolvedTo(CONTRACTS)] obj: R|Foo|): R|kotlin/Unit| {
}
@@ -0,0 +1,10 @@
interface Foo {}
fun test(obj: Any) {
<expr>obj.hashCode()</expr>
if (obj is Foo) {
consume(obj)
}
}
fun consume(obj: Foo) {}
@@ -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
Element 7
Scope: FirLocalScope
Properties:
FirValueParameterSymbol obj: R|kotlin/Any|
Element 8
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] beforeIf.kt
public abstract [ResolvedTo(STATUS)] interface Foo : R|kotlin/Any| {
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] obj: R|kotlin/Any|): R|kotlin/Unit| {
R|<local>/obj|.R|kotlin/Any.hashCode|()
when () {
(R|<local>/obj| is R|Foo|) -> {
R|/consume|(R|<local>/obj|)
}
}
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] obj: R|Foo|): R|kotlin/Unit| {
}
@@ -0,0 +1,14 @@
interface Node {
val parent: Node?
}
fun test(initial: Node) {
<expr>var current = initial</expr>
while (current != null) {
consume(current)
current = current.parent
}
}
fun consume(node: Node) {}
@@ -0,0 +1,38 @@
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: FirLocalScope
Properties:
FirValueParameterSymbol initial: R|Node|
Element 8
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] beforeLoop.kt
public abstract [ResolvedTo(STATUS)] interface Node : R|kotlin/Any| {
public abstract [ResolvedTo(CONTRACTS)] val parent: R|Node?|
public [ResolvedTo(CONTRACTS)] get(): R|Node?|
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] initial: R|Node|): R|kotlin/Unit| {
[ResolvedTo(BODY_RESOLVE)] lvar current: R|Node| = R|<local>/initial|
while(!=(R|<local>/current|, Null(null))) {
R|/consume|(R|<local>/current|)
R|<local>/current| = R|<local>/current|.R|/Node.parent|
}
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] node: R|Node|): R|kotlin/Unit| {
}
@@ -0,0 +1,11 @@
open class Foo {
fun foo() {
if (this is Bar) {
<expr>consume(this)</expr>
}
}
}
class Bar : Foo()
fun consume(obj: Bar) {}
@@ -0,0 +1,55 @@
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
Implicit receiver:
FirRegularClassSymbol public open class Foo : R|kotlin/Any|
Type: Bar
Element 8
Scope: FirLocalScope
Element 9
Scope: FirLocalScope
Element 10
Scope: FirLocalScope
Smart Casts:
FirRegularClassSymbol public open class Foo : R|kotlin/Any|
Types:
Bar
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] dispatchReceiver.kt
public open [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(): R|kotlin/Unit| {
when () {
(this@R|/Foo| is R|Bar|) -> {
R|/consume|(this@R|/Foo|)
}
}
}
}
public final [ResolvedTo(STATUS)] class Bar : R|Foo| {
public [ResolvedTo(STATUS)] constructor(): R|Bar| {
LAZY_super<R|Foo|>
}
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] obj: R|Bar|): R|kotlin/Unit| {
}
@@ -0,0 +1,9 @@
interface Foo {}
fun Any.test() {
if (this is Foo) {
<expr>consume(this)</expr>
}
}
fun consume(obj: Foo) {}
@@ -0,0 +1,44 @@
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: FirLocalScope
Element 8
Implicit receiver:
FirNamedFunctionSymbol public final fun R|kotlin/Any|.test(): R|kotlin/Unit|
Type: Foo
Element 9
Scope: FirLocalScope
Element 10
Scope: FirLocalScope
Smart Casts:
FirNamedFunctionSymbol public final fun R|kotlin/Any|.test(): R|kotlin/Unit|
Types:
Foo
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] extensionReceiver.kt
public abstract [ResolvedTo(STATUS)] interface Foo : R|kotlin/Any| {
}
public final [ResolvedTo(BODY_RESOLVE)] fun R|kotlin/Any|.test(): R|kotlin/Unit| {
when () {
(this@R|/test| is R|Foo|) -> {
R|/consume|(this@R|/test|)
}
}
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] obj: R|Foo|): R|kotlin/Unit| {
}
@@ -0,0 +1,7 @@
fun foo(param: String?): String {
param?.let {
return <expr>param</expr>
}
return ""
}
@@ -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
Element 7
Scope: FirLocalScope
Properties:
FirValueParameterSymbol param: R|kotlin/String?|
Element 8
Scope: FirLocalScope
Element 9
Scope: FirLocalScope
Properties:
FirValueParameterSymbol it: R|kotlin/String|
Element 10
Scope: FirLocalScope
Smart Casts:
FirValueParameterSymbol param: R|kotlin/String?|
Types:
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] insideLetOnNullableReceiver.kt
public final [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] param: R|kotlin/String?|): R|kotlin/String| {
R|<local>/param|?.{ $subj$.R|kotlin/let|<R|kotlin/String|, R|kotlin/Nothing|>(<L> = [ResolvedTo(BODY_RESOLVE)] let@fun <anonymous>([ResolvedTo(BODY_RESOLVE)] it: R|kotlin/String|): R|kotlin/Nothing| <inline=Inline, kind=EXACTLY_ONCE> {
^foo R|<local>/param|
}
) }
^foo String()
}
@@ -0,0 +1,14 @@
interface Node {
val parent: Node?
}
fun test(initial: Node) {
var current = initial
while (current != null) {
<expr>consume(current)</expr>
current = current.parent
}
}
fun consume(node: Node) {}
@@ -0,0 +1,46 @@
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: FirLocalScope
Properties:
FirValueParameterSymbol initial: R|Node|
Element 8
Scope: FirLocalScope
Properties:
FirPropertySymbol lvar current: R|Node|
Element 9
Scope: FirLocalScope
Smart Casts:
FirPropertySymbol lvar current: R|Node|
Types:
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] insideLoop.kt
public abstract [ResolvedTo(STATUS)] interface Node : R|kotlin/Any| {
public abstract [ResolvedTo(CONTRACTS)] val parent: R|Node?|
public [ResolvedTo(CONTRACTS)] get(): R|Node?|
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] initial: R|Node|): R|kotlin/Unit| {
[ResolvedTo(BODY_RESOLVE)] lvar current: R|Node| = R|<local>/initial|
while(!=(R|<local>/current|, Null(null))) {
R|/consume|(R|<local>/current|)
R|<local>/current| = R|<local>/current|.R|/Node.parent|
}
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] node: R|Node|): R|kotlin/Unit| {
}
@@ -0,0 +1,13 @@
interface Foo {
val isValid: Boolean
}
fun test(obj: Any) {
if (obj is Foo || <expr>isValid(obj)</expr>) {
consume(obj)
}
}
fun isValid(obj: Any): Boolean = true
fun consume(obj: Foo) {}
@@ -0,0 +1,41 @@
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: FirLocalScope
Properties:
FirValueParameterSymbol obj: R|kotlin/Any|
Element 8
Scope: FirLocalScope
FILE: [ResolvedTo(IMPORTS)] orRight.kt
public? final? [ResolvedTo(RAW_FIR)] interface Foo : R|kotlin/Any| {
public? final? [ResolvedTo(RAW_FIR)] val isValid: Boolean
public? [ResolvedTo(RAW_FIR)] get(): Boolean
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] obj: R|kotlin/Any|): R|kotlin/Unit| {
when () {
(R|<local>/obj| is R|Foo|) || R|/isValid|(R|<local>/obj|) -> {
R|/consume<Inapplicable(INAPPLICABLE): /consume>#|(R|<local>/obj|)
}
}
}
public final [ResolvedTo(CONTRACTS)] fun isValid([ResolvedTo(CONTRACTS)] obj: R|kotlin/Any|): R|kotlin/Boolean| {
^isValid Boolean(true)
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] obj: R|Foo|): R|kotlin/Unit| {
}
@@ -0,0 +1,9 @@
interface Foo {}
fun test(obj: Any, another: Foo) {
if (obj is Foo) {
<expr>consume(another)</expr>
}
}
fun consume(obj: Foo) {}
@@ -0,0 +1,43 @@
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: FirLocalScope
Properties:
FirValueParameterSymbol another: R|Foo|
FirValueParameterSymbol obj: R|kotlin/Any|
Element 8
Scope: FirLocalScope
Element 9
Scope: FirLocalScope
Smart Casts:
FirValueParameterSymbol obj: R|kotlin/Any|
Types:
Foo
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] plainCheck.kt
public abstract [ResolvedTo(STATUS)] interface Foo : R|kotlin/Any| {
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] obj: R|kotlin/Any|, [ResolvedTo(BODY_RESOLVE)] another: R|Foo|): R|kotlin/Unit| {
when () {
(R|<local>/obj| is R|Foo|) -> {
R|/consume|(R|<local>/another|)
}
}
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] obj: R|Foo|): R|kotlin/Unit| {
}
@@ -0,0 +1,10 @@
// WITH_STDLIB
interface Foo
fun test(obj: Any) {
require(obj is Foo)
<expr>consume(obj)</expr>
}
fun consume(obj: Any) {}
@@ -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
Element 7
Scope: FirLocalScope
Properties:
FirValueParameterSymbol obj: R|kotlin/Any|
Element 8
Scope: FirLocalScope
Smart Casts:
FirValueParameterSymbol obj: R|kotlin/Any|
Types:
Foo
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] require.kt
public abstract [ResolvedTo(STATUS)] interface Foo : R|kotlin/Any| {
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] obj: R|kotlin/Any|): R|kotlin/Unit| {
R|kotlin/require|((R|<local>/obj| is R|Foo|))
R|/consume|(R|<local>/obj|)
}
public final [ResolvedTo(CONTRACTS)] fun consume([ResolvedTo(CONTRACTS)] obj: R|kotlin/Any|): R|kotlin/Unit| {
}
@@ -0,0 +1,14 @@
interface Foo {
fun foo()
}
interface Bar {
fun bar()
}
fun test(obj: Any) {
when (obj) {
is Foo -> obj.foo()
is Bar -> <expr>obj.bar()</expr>
}
}
@@ -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: FirLocalScope
Properties:
FirValueParameterSymbol obj: R|kotlin/Any|
Element 8
Scope: FirLocalScope
Element 9
Scope: FirLocalScope
Smart Casts:
FirValueParameterSymbol obj: R|kotlin/Any|
Types:
Bar
kotlin/Any
FILE: [ResolvedTo(IMPORTS)] when.kt
public abstract [ResolvedTo(STATUS)] interface Foo : R|kotlin/Any| {
public abstract [ResolvedTo(CONTRACTS)] fun foo(): R|kotlin/Unit|
}
public abstract [ResolvedTo(STATUS)] interface Bar : R|kotlin/Any| {
public abstract [ResolvedTo(CONTRACTS)] fun bar(): R|kotlin/Unit|
}
public final [ResolvedTo(BODY_RESOLVE)] fun test([ResolvedTo(BODY_RESOLVE)] obj: R|kotlin/Any|): R|kotlin/Unit| {
when (R|<local>/obj|) {
($subj$ is R|Foo|) -> {
R|<local>/obj|.R|/Foo.foo|()
}
($subj$ is R|Bar|) -> {
R|<local>/obj|.R|/Bar.bar|()
}
}
}