[FE] Prohibit inheritance of sealed classes in different module
KT-20423
This commit is contained in:
committed by
TeamCityServer
parent
f8d6f79c17
commit
57a081c399
+7
@@ -0,0 +1,7 @@
|
||||
package a
|
||||
|
||||
sealed class Base
|
||||
|
||||
sealed interface IBase
|
||||
|
||||
class A : Base(), IBase
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// ISSUE: KT-20423
|
||||
|
||||
package a
|
||||
|
||||
class B : Base(), IBase
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
warning: ATTENTION!
|
||||
This build uses unsafe internal compiler arguments:
|
||||
|
||||
-XXLanguage:+FreedomForSealedClasses
|
||||
-XXLanguage:+SealedInterfaces
|
||||
|
||||
This mode is not recommended for production use,
|
||||
as no stability/compatibility guarantees are given on
|
||||
compiler or generated code. Use it at your own risk!
|
||||
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/sealedInheritorInDifferentModule/main.kt:5:11: error: cannot access '<init>': it is internal in 'Base'
|
||||
class B : Base(), IBase
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/sealedInheritorInDifferentModule/main.kt:5:11: error: inheritance of sealed classes or interfaces from different module is prohibited
|
||||
class B : Base(), IBase
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/sealedInheritorInDifferentModule/main.kt:5:19: error: inheritance of sealed classes or interfaces from different module is prohibited
|
||||
class B : Base(), IBase
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
Reference in New Issue
Block a user