Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/whenElse.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

105 lines
2.7 KiB
Plaintext
Vendored

FILE: whenElse.kt
public final enum class A : R|kotlin/Enum<A>| {
private constructor(): R|A| {
super<R|kotlin/Enum<A>|>()
}
public final static enum entry A1: R|A|
public final static enum entry A2: R|A|
public final static fun values(): R|kotlin/Array<A>| {
}
public final static fun valueOf(value: R|kotlin/String|): R|A| {
}
}
public final class B : R|kotlin/Any| {
public constructor(): R|B| {
super<R|kotlin/Any|>()
}
}
public final class C : R|kotlin/Any| {
public constructor(b: R|B|): R|C| {
super<R|kotlin/Any|>()
}
public final val b: R|B| = R|<local>/b|
public get(): R|B|
}
public final fun get(f: R|kotlin/Boolean|): R|kotlin/Any| {
^get when () {
R|<local>/f| -> {
Q|A|.R|/A.A1|
}
else -> {
String()
}
}
}
public final fun case2(): R|kotlin/Unit| {
lval flag: R|kotlin/Any| = R|/get|(Boolean(false))
lval l1: R|kotlin/Unit| = when (R|<local>/flag|!!) {
==($subj$, Q|A|.R|/A.A1|) -> {
R|/B.B|()
}
==($subj$, Q|A|.R|/A.A2|) -> {
R|/B.B|()
}
}
lval l2: R|kotlin/Unit| = when (R|<local>/flag|) {
==($subj$, Q|A|.R|/A.A1|) -> {
R|/B.B|()
}
==($subj$, Q|A|.R|/A.A2|) -> {
R|/B.B|()
}
}
}
public final fun case2(): R|kotlin/Unit| {
lval flag: R|kotlin/Any| = R|/get|(Boolean(true))
lval l1: R|kotlin/Unit| = when (R|<local>/flag|!!) {
==($subj$, Q|A|.R|/A.A1|) -> {
R|/B.B|()
}
==($subj$, Q|A|.R|/A.A2|) -> {
R|/B.B|()
}
}
lval l2: R|kotlin/Unit| = when (R|<local>/flag|) {
==($subj$, Q|A|.R|/A.A1|) -> {
R|/B.B|()
}
==($subj$, Q|A|.R|/A.A2|) -> {
R|/B.B|()
}
}
}
public final fun case3(): R|kotlin/Unit| {
lval flag: R|kotlin/String| = String()
lval l1: R|kotlin/Unit| = when (R|<local>/flag|!!) {
==($subj$, Q|A|.R|/A.A1|) -> {
R|/B.B|()
}
==($subj$, Q|A|.R|/A.A2|) -> {
R|/B.B|()
}
}
lval l2: R|kotlin/Unit| = when (R|<local>/flag|) {
==($subj$, Q|A|.R|/A.A1|) -> {
R|/B.B|()
}
==($subj$, Q|A|.R|/A.A2|) -> {
R|/B.B|()
}
}
}