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,3 @@
sealed class Base
sealed class Intermediate : Base()
class Impl1 : Intermediate()
@@ -0,0 +1,4 @@
sealed class Base
sealed class Intermediate : Base()
class Impl1 : Intermediate()
class Impl2 : Intermediate()
@@ -0,0 +1,40 @@
================ Step #1 =================
Cleaning output files:
out/production/module/Base.class
out/production/module/Impl1.class
out/production/module/Intermediate.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 Impl2' branch or 'else' branch instead
================ Step #2 =================
Cleaning output files:
out/production/module/Base.class
out/production/module/Impl1.class
out/production/module/Impl2.class
out/production/module/Intermediate.class
End of files
Compiling files:
src/Base.kt
src/use.kt
End of files
Exit code: OK
------------------------------------------
@@ -0,0 +1,4 @@
fun use(x: Base): Int =
when (x) {
is Impl1 -> 1
}
@@ -0,0 +1,5 @@
fun use(x: Base): Int =
when (x) {
is Impl1 -> 1
is Impl2 -> 2
}