blob: af5f9225940c26e70127ba4713b5ce3211d34a83 [file]
// RUN_PIPELINE_TILL: FRONTEND
// FIR_IDENTICAL
/*
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
*
* SPEC VERSION: 0.1-152
* PRIMARY LINKS: expressions, when-expression -> paragraph 5 -> sentence 1
* expressions, when-expression, exhaustive-when-expressions -> paragraph 1 -> sentence 1
* expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 3
* expressions, when-expression, exhaustive-when-expressions -> paragraph 2 -> sentence 10
*/
// See also: KT-3743
fun foo(arg: Boolean?): String {
// Must be NOT exhaustive
return <!NO_ELSE_IN_WHEN!>when<!>(arg) {
true -> "truth"
false -> "falsehood"
}
}
/* GENERATED_FIR_TAGS: equalityExpression, functionDeclaration, nullableType, smartcast, stringLiteral, whenExpression,
whenWithSubject */