Add test for obsolete issue
#KT-4434 Obsolete
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
// KT-4434 Missed diagnostic about else branch in when
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
fun foo(): Int {
|
||||||
|
val a = "a"
|
||||||
|
return if (a.length() > 0) {
|
||||||
|
<!NO_ELSE_IN_WHEN!>when<!> (a) {
|
||||||
|
"a" -> 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun bar(): Int {
|
||||||
|
val a = "a"
|
||||||
|
if (a.length() > 0) {
|
||||||
|
return <!NO_ELSE_IN_WHEN!>when<!> (a) {
|
||||||
|
"a" -> 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 3
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
package test {
|
||||||
|
internal fun bar(): kotlin.Int
|
||||||
|
internal fun foo(): kotlin.Int
|
||||||
|
}
|
||||||
@@ -10635,6 +10635,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt4434.kt")
|
||||||
|
public void testKt4434() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/when/kt4434.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("NoElseExpectedUnit.kt")
|
@TestMetadata("NoElseExpectedUnit.kt")
|
||||||
public void testNoElseExpectedUnit() throws Exception {
|
public void testNoElseExpectedUnit() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/when/NoElseExpectedUnit.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user