KT-46063 Quick fix: remaining when branches for 'expect' sealed
'List<WhenMissingCase>.hasUnknown' property was changed in 4222bb9a.
As a result quickfix's AddWhenRemainingBranchesFix.Companion.isAvailable
started responding 'no'.
This commit restores original property and provides a separate one for
compiler needs.
^KT-46063 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// "Add remaining branches" "true"
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// ERROR: Expected class 'CommonSealedClass' has no actual declaration in module testModule_Common
|
||||
// ERROR: Unresolved reference: TODO
|
||||
// ERROR: Unresolved reference: TODO
|
||||
// ERROR: Unresolved reference: TODO
|
||||
|
||||
expect sealed class CommonSealedClass()
|
||||
class SInheritor1 : CommonSealedClass()
|
||||
class SInheritor2 : CommonSealedClass()
|
||||
|
||||
fun hello(c: CommonSealedClass): Int = <caret>when(c) {
|
||||
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// "Add remaining branches" "true"
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// ERROR: Expected class 'CommonSealedClass' has no actual declaration in module testModule_Common
|
||||
// ERROR: Unresolved reference: TODO
|
||||
// ERROR: Unresolved reference: TODO
|
||||
// ERROR: Unresolved reference: TODO
|
||||
|
||||
expect sealed class CommonSealedClass()
|
||||
class SInheritor1 : CommonSealedClass()
|
||||
class SInheritor2 : CommonSealedClass()
|
||||
|
||||
fun hello(c: CommonSealedClass): Int = <selection><caret></selection>when(c) {
|
||||
is SInheritor1 -> TODO()
|
||||
is SInheritor2 -> TODO()
|
||||
else -> TODO()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Add remaining branches" "true"
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// ERROR: Unresolved reference: TODO
|
||||
// ERROR: Unresolved reference: TODO
|
||||
|
||||
sealed class CommonSealedClass()
|
||||
class SInheritor1 : CommonSealedClass()
|
||||
class SInheritor2 : CommonSealedClass()
|
||||
|
||||
fun hello(c: CommonSealedClass): Int = <caret>when(c) {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Add remaining branches" "true"
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// ERROR: Unresolved reference: TODO
|
||||
// ERROR: Unresolved reference: TODO
|
||||
|
||||
sealed class CommonSealedClass()
|
||||
class SInheritor1 : CommonSealedClass()
|
||||
class SInheritor2 : CommonSealedClass()
|
||||
|
||||
fun hello(c: CommonSealedClass): Int = <selection><caret></selection>when(c) {
|
||||
is SInheritor1 -> TODO()
|
||||
is SInheritor2 -> TODO()
|
||||
}
|
||||
Reference in New Issue
Block a user