[Spec tests] Add test for Coercion to Unit error diagnostics absence
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
val y0 = when (2) {
|
||||
else -> if (true) {""}
|
||||
}
|
||||
|
||||
val w:Any = TODO()
|
||||
|
||||
val y1 = when (2) {
|
||||
else -> if (true) {""} // false ok with coercion to Unit
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: coercion-to-unit
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Coercion to Unit error diagnostics absence
|
||||
* ISSUES: KT-38490
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
|
||||
val y0 = when (<!UNUSED_EXPRESSION!>2<!>) {
|
||||
else -> <!INVALID_IF_AS_EXPRESSION!>if<!> (true) {""}
|
||||
}
|
||||
|
||||
val w:Any = TODO()
|
||||
|
||||
val y1 = when (2) {
|
||||
else -> if (true) {""} // false ok with coercion to Unit
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public val w: kotlin.Any
|
||||
public val y0: kotlin.Unit
|
||||
public val y1: kotlin.Unit
|
||||
Reference in New Issue
Block a user