Files
kotlin-fork/compiler/testData/diagnostics/tests/sealed/NeverConstructed.kt
T
Mikhail Glukhikh 8d25c20169 Introduction of sealed classes
Sealed classes can be derived only by their own inner classes or objects.
Their constructors cannot be called explicitly, so compiler knows all their descendants.
Incompatible modifier checks (final, abstract). Impossible with interface, object, enum.
A pack of tests provided.
2015-06-25 19:07:13 +03:00

4 lines
81 B
Kotlin
Vendored

sealed class Base {
fun foo() = <!SEALED_CLASS_CONSTRUCTOR_CALL!>Base()<!>
}