[AA] KtExpressionInfoProvider.getMissingCases: fix no subject case
return missing else branch (even if it's present, see kdoc) ^ KT-62875 fixed
This commit is contained in:
+9
@@ -36,6 +36,15 @@ public interface KtExpressionInfoProviderMixIn : KtAnalysisSessionMixIn {
|
||||
* else -> 3
|
||||
* }
|
||||
*
|
||||
* If when-expression has no subject, then else-branch would be reported as missing even if it is explicitly present:
|
||||
*
|
||||
* fun test() {
|
||||
* when {
|
||||
* true -> {}
|
||||
* else -> {}
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* Note that this function returns the same missing cases regardless of the existence of the else branch.
|
||||
* If you have to assume that it does not have the missing cases when it has an else branch,
|
||||
* you need a separate check whether it has an else branch or not.
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun test() {
|
||||
<caret>when {
|
||||
true -> {}
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Unknown - else
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun test() {
|
||||
<caret>when() {
|
||||
true -> {}
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Unknown - else
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun test() {
|
||||
<caret>when {
|
||||
true -> {}
|
||||
else -> { }
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Unknown - else
|
||||
Reference in New Issue
Block a user