Treat SEALED_SUBCLASS_FQ_NAME_LIST change as a class signature change

#KT-19580
This commit is contained in:
Alexey Tsvetkov
2017-08-09 22:15:38 +03:00
parent 856276328e
commit 6354d9d54f
39 changed files with 440 additions and 18 deletions
@@ -0,0 +1,4 @@
sealed class Base {
class A : Base()
class B : Base()
}
@@ -0,0 +1,5 @@
sealed class Base {
class A : Base()
class B : Base()
class C : Base()
}
@@ -0,0 +1,40 @@
================ Step #1 =================
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
Marked as dirty by Kotlin:
src/use.kt
Exit code: ADDITIONAL_PASS_REQUIRED
------------------------------------------
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
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
'when' expression must be exhaustive, add necessary 'is C' branch or 'else' branch instead
================ Step #2 =================
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
Exit code: OK
------------------------------------------
@@ -0,0 +1,7 @@
import Base.*
fun use(x: Base): String =
when (x) {
is A -> "A"
is B -> "B"
}
@@ -0,0 +1,8 @@
import Base.*
fun use(x: Base): String =
when (x) {
is A -> "A"
is B -> "B"
is C -> "C"
}