Recompile all sealed class usages when new derived class is added
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
sealed class Base {
|
||||
class A : Base()
|
||||
class B : Base()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
sealed class Base {
|
||||
class A : Base()
|
||||
class B : Base()
|
||||
class C : Base()
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
Cleaning output files:
|
||||
out/production/module/Base$A.class
|
||||
out/production/module/Base$B.class
|
||||
out/production/module/Base.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/Base.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/UseKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/use.kt
|
||||
End of files
|
||||
COMPILATION FAILED
|
||||
'when' expression must be exhaustive or contain an 'else' branch
|
||||
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/Base$A.class
|
||||
out/production/module/Base$B.class
|
||||
out/production/module/Base$C.class
|
||||
out/production/module/Base.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/Base.kt
|
||||
src/use.kt
|
||||
End of files
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import Base.*
|
||||
|
||||
fun use(x: Base): String =
|
||||
when (x) {
|
||||
is A -> "A"
|
||||
is B -> "B"
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import Base.*
|
||||
|
||||
fun use(x: Base): String =
|
||||
when (x) {
|
||||
is A -> "A"
|
||||
is B -> "B"
|
||||
is C -> "C"
|
||||
}
|
||||
Reference in New Issue
Block a user