[FE 1.0] Report NON_EXHAUSTIVE_WHEN_STATEMENT/NO_ELSE_IN_WHEN for when's on logical types
^KT-47709 In Progress
This commit is contained in:
committed by
teamcityserver
parent
85c7f386eb
commit
ef635f6a96
@@ -7,7 +7,7 @@ fun foo(my: My) {
|
||||
if (my.x != null) {
|
||||
// my.x should be smart-cast
|
||||
if (<!DEBUG_INFO_SMARTCAST!>my.x<!>) doIt()
|
||||
when (<!DEBUG_INFO_SMARTCAST!>my.x<!>) {
|
||||
<!NON_EXHAUSTIVE_WHEN_STATEMENT!>when<!> (<!DEBUG_INFO_SMARTCAST!>my.x<!>) {
|
||||
true -> doIt()
|
||||
}
|
||||
when {
|
||||
@@ -20,11 +20,11 @@ fun bar(x: Boolean?) {
|
||||
if (x != null) {
|
||||
// x should be smart-cast
|
||||
if (<!DEBUG_INFO_SMARTCAST!>x<!>) doIt()
|
||||
when (<!DEBUG_INFO_SMARTCAST!>x<!>) {
|
||||
<!NON_EXHAUSTIVE_WHEN_STATEMENT!>when<!> (<!DEBUG_INFO_SMARTCAST!>x<!>) {
|
||||
true -> doIt()
|
||||
}
|
||||
when {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!> -> doIt()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user