e6b5cb5216
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
94 lines
2.8 KiB
Plaintext
Vendored
94 lines
2.8 KiB
Plaintext
Vendored
FILE: boundSmartcasts.kt
|
|
public abstract interface A : R|kotlin/Any| {
|
|
public abstract fun foo(): R|kotlin/Unit|
|
|
|
|
}
|
|
public abstract interface B : R|kotlin/Any| {
|
|
public abstract fun bar(): R|kotlin/Unit|
|
|
|
|
}
|
|
public final fun test_1(x: R|kotlin/Any|): R|kotlin/Unit| {
|
|
lval y: R|kotlin/Any| = R|<local>/x|
|
|
when () {
|
|
(R|<local>/x| is R|A|) -> {
|
|
R|<local>/x|.R|/A.foo|()
|
|
R|<local>/y|.R|/A.foo|()
|
|
}
|
|
}
|
|
|
|
}
|
|
public final fun test_2(x: R|kotlin/Any|): R|kotlin/Unit| {
|
|
lval y: R|kotlin/Any| = R|<local>/x|
|
|
when () {
|
|
(R|<local>/y| is R|A|) -> {
|
|
R|<local>/x|.R|/A.foo|()
|
|
R|<local>/y|.R|/A.foo|()
|
|
}
|
|
}
|
|
|
|
}
|
|
public final fun test_3(x: R|kotlin/Any|, y: R|kotlin/Any|): R|kotlin/Unit| {
|
|
lvar z: R|kotlin/Any| = R|<local>/x|
|
|
when () {
|
|
(R|<local>/x| is R|A|) -> {
|
|
R|<local>/z|.R|/A.foo|()
|
|
}
|
|
}
|
|
|
|
R|<local>/z| = R|<local>/y|
|
|
when () {
|
|
(R|<local>/y| is R|B|) -> {
|
|
R|<local>/z|.<Unresolved name: foo>#()
|
|
R|<local>/z|.R|/B.bar|()
|
|
}
|
|
}
|
|
|
|
}
|
|
public final fun test_4(y: R|kotlin/Any|): R|kotlin/Unit| {
|
|
lvar x: R|kotlin/Any| = Int(1)
|
|
(R|<local>/x| as R|kotlin/Int|)
|
|
R|<local>/x|.R|kotlin/Int.inc|()
|
|
R|<local>/x| = R|<local>/y|
|
|
R|<local>/x|.<Unresolved name: inc>#()
|
|
when () {
|
|
(R|<local>/y| is R|A|) -> {
|
|
R|<local>/x|.R|/A.foo|()
|
|
R|<local>/y|.R|/A.foo|()
|
|
}
|
|
}
|
|
|
|
}
|
|
public final class D : R|kotlin/Any| {
|
|
public constructor(any: R|kotlin/Any?|): R|D| {
|
|
super<R|kotlin/Any|>()
|
|
}
|
|
|
|
public final val any: R|kotlin/Any?| = R|<local>/any|
|
|
public get(): R|kotlin/Any?|
|
|
|
|
}
|
|
public final fun R|kotlin/Any|.baz(): R|kotlin/Unit| {
|
|
}
|
|
public final fun test_5(d: R|D|): R|kotlin/Unit| {
|
|
lval a: R|kotlin/Any| = R|<local>/d|.R|/D.any| ?: ^test_5 Unit
|
|
R|<local>/a|.R|/baz|()
|
|
R|<local>/d|.R|/D.any|.R|/baz|()
|
|
(R|<local>/a| as R|A|)
|
|
R|<local>/a|.R|/A.foo|()
|
|
}
|
|
public final fun test_6(d1: R|D|): R|kotlin/Unit| {
|
|
lval a: R|kotlin/Any?| = R|<local>/d1|.R|/D.any|
|
|
(R|<local>/a| as R|A|)
|
|
R|<local>/a|.R|/A.foo|()
|
|
R|<local>/d1|.R|/D.any|.R|/A.foo|()
|
|
R|<local>/d1|.R|/D.any|.R|/baz|()
|
|
}
|
|
public final fun test_7(d1: R|D|, d2: R|D|): R|kotlin/Unit| {
|
|
lval a: R|kotlin/Any?| = R|<local>/d1|?.{ $subj$.R|/D.any| }
|
|
lval b: R|kotlin/Any?| = R|<local>/d2|?.{ $subj$.R|/D.any| }
|
|
(R|<local>/a| as R|A|)
|
|
R|<local>/a|.R|/A.foo|()
|
|
(R|<local>/b| as R|B|)
|
|
R|<local>/b|.R|/B.bar|()
|
|
}
|