mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
KT-3750 When without else
#KT-3750 Fixed GitOrigin-RevId: 3f0280142dd950caf69d5f487f679702abdcf794
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e3ea6422bb
commit
5a8d912d56
+5
@@ -268,6 +268,11 @@ public class JetPsiCheckerTestGenerated extends AbstractJetPsiCheckerTest {
|
||||
doTest("idea/testData/checker/When.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("WhenInEnumInExtensionProperty.kt")
|
||||
public void testWhenInEnumInExtensionProperty() throws Exception {
|
||||
doTest("idea/testData/checker/WhenInEnumInExtensionProperty.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/checker/regression")
|
||||
|
||||
+4
@@ -59,6 +59,10 @@ public class OutOfBlockModificationTest extends LightCodeInsightFixtureTestCase
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInGlobalPropertyWithGetter() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInMethod() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// KT-3750 When without else
|
||||
|
||||
enum class A {
|
||||
e1
|
||||
e2
|
||||
}
|
||||
class B(val a: A)
|
||||
val B.foo: Int
|
||||
get() {
|
||||
// Check absence [NO_ELSE_IN_WHEN] error
|
||||
return when (a) {
|
||||
A.e1 -> 1
|
||||
A.e2 -> 3
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FALSE
|
||||
class B(val a: A)
|
||||
val B.foo: Int
|
||||
get() {
|
||||
return <caret>when (a) {
|
||||
A.e1 -> 1
|
||||
A.e2 -> 4
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user