Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedClass.fir.txt
T
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
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
2020-12-16 19:52:25 +03:00

127 lines
3.0 KiB
Plaintext
Vendored

FILE: exhaustiveness_sealedClass.kt
public sealed class Base : R|kotlin/Any| {
private constructor(): R|Base| {
super<R|kotlin/Any|>()
}
public final class A : R|Base| {
public constructor(): R|Base.A| {
super<R|Base|>()
}
public final class B : R|Base| {
public constructor(): R|Base.A.B| {
super<R|Base|>()
}
}
}
}
public final class C : R|Base| {
public constructor(): R|C| {
super<R|Base|>()
}
}
public final fun test_1(e: R|Base|): R|kotlin/Unit| {
lval a: R|kotlin/Unit| = when (R|<local>/e|) {
($subj$ is R|Base.A|) -> {
Int(1)
}
($subj$ is R|Base.A.B|) -> {
Int(2)
}
}
lval b: R|kotlin/Unit| = when (R|<local>/e|) {
($subj$ is R|Base.A|) -> {
Int(1)
}
($subj$ is R|Base.A.B|) -> {
Int(2)
}
($subj$ is R|kotlin/String|) -> {
Int(3)
}
}
lval c: R|kotlin/Int| = when (R|<local>/e|) {
($subj$ is R|Base.A|) -> {
Int(1)
}
($subj$ is R|Base.A.B|) -> {
Int(2)
}
($subj$ is R|C|) -> {
Int(3)
}
}
lval d: R|kotlin/Int| = when (R|<local>/e|) {
($subj$ is R|Base.A|) -> {
Int(1)
}
else -> {
Int(2)
}
}
}
public final fun test_2(e: R|Base?|): R|kotlin/Unit| {
lval a: R|kotlin/Unit| = when (R|<local>/e|) {
($subj$ is R|Base.A|) -> {
Int(1)
}
($subj$ is R|Base.A.B|) -> {
Int(2)
}
($subj$ is R|C|) -> {
Int(3)
}
}
lval b: R|kotlin/Int| = when (R|<local>/e|) {
($subj$ is R|Base.A|) -> {
Int(1)
}
($subj$ is R|Base.A.B|) -> {
Int(2)
}
($subj$ is R|C|) -> {
Int(3)
}
==($subj$, Null(null)) -> {
Int(4)
}
}
lval c: R|kotlin/Int| = when (R|<local>/e|) {
($subj$ is R|Base.A|) -> {
Int(1)
}
($subj$ is R|Base.A.B|) -> {
Int(2)
}
($subj$ is R|C|) -> {
Int(3)
}
else -> {
Int(4)
}
}
}
public final fun test_3(e: R|Base|): R|kotlin/Unit| {
lval a: R|kotlin/Int| = when (R|<local>/e|) {
($subj$ is R|Base.A|) || ($subj$ is R|Base.A.B|) -> {
Int(1)
}
($subj$ is R|C|) -> {
Int(2)
}
}
}