Files
kotlin-fork/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt.txt
T
2020-11-26 00:14:55 +03:00

119 lines
2.3 KiB
Plaintext
Vendored

enum class A : Enum<A> {
private constructor() /* primary */ {
super/*Enum*/<A>()
/* <init>() */
}
V1 = A()
fun values(): Array<A> /* Synthetic body for ENUM_VALUES */
fun valueOf(value: String): A /* Synthetic body for ENUM_VALUEOF */
}
fun testVariableAssignment_throws(a: A) {
val x: Int
{ // BLOCK
val tmp0_subject: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> x = 11
else -> noWhenBranchMatchedException()
}
}
}
fun testStatement_empty(a: A) {
{ // BLOCK
val tmp0_subject: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
fun testParenthesized_throwsJvm(a: A) {
{ // BLOCK
val tmp0_subject: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
fun testAnnotated_throwsJvm(a: A) {
{ // BLOCK
val tmp0_subject: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
fun testExpression_throws(a: A): Int {
return { // BLOCK
val tmp0_subject: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
}
}
fun testIfTheElseStatement_empty(a: A, flag: Boolean) {
when {
flag -> 0 /*~> Unit */
else -> { // BLOCK
{ // BLOCK
val tmp0_subject: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
}
}
fun testIfTheElseParenthesized_throwsJvm(a: A, flag: Boolean) {
when {
flag -> 0 /*~> Unit */
else -> { // BLOCK
{ // BLOCK
val tmp0_subject: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
}
}
fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean) {
when {
flag -> 0 /*~> Unit */
else -> { // BLOCK
{ // BLOCK
val tmp0_subject: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1 /*~> Unit */
}
}
}
}
}
fun testLambdaResultExpression_throws(a: A) {
local fun <anonymous>(): Int {
return { // BLOCK
val tmp0_subject: A = a
when {
EQEQ(arg0 = tmp0_subject, arg1 = A.V1) -> 1
else -> noWhenBranchMatchedException()
}
}
}
.invoke() /*~> Unit */
}