KT-43941 [Sealed interfaces]: subclass intention
Restriction for sealed inheritors was relaxed. Instead of being nested class members now they can be the members of the same module and package.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// "Implement sealed class" "true"
|
||||
// WITH_RUNTIME
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+SealedInterfaces
|
||||
|
||||
sealed class <caret>Base {
|
||||
abstract fun foo(): Int
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Implement sealed class" "true"
|
||||
// WITH_RUNTIME
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+SealedInterfaces
|
||||
|
||||
sealed class Base {
|
||||
abstract fun foo(): Int
|
||||
}
|
||||
|
||||
class BaseImpl : Base() {
|
||||
override fun foo(): Int {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// "Implement sealed class" "true"
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+SealedInterfaces
|
||||
sealed class <caret>Sealed
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Implement sealed class" "true"
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+SealedInterfaces
|
||||
sealed class Sealed
|
||||
<caret>class SealedImpl : Sealed()
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Implement sealed class" "true"
|
||||
// WITH_RUNTIME
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+SealedInterfaces
|
||||
|
||||
sealed class <caret>Base {
|
||||
abstract fun foo(): Int
|
||||
|
||||
class BaseImpl : Base() {
|
||||
override fun foo() = throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// "Implement sealed class" "true"
|
||||
// WITH_RUNTIME
|
||||
// SHOULD_BE_AVAILABLE_AFTER_EXECUTION
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+SealedInterfaces
|
||||
|
||||
sealed class Base {
|
||||
abstract fun foo(): Int
|
||||
|
||||
class BaseImpl : Base() {
|
||||
override fun foo() = throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
class BaseImpl : Base() {
|
||||
override fun foo(): Int {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user