8d25c20169
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.
35 lines
543 B
Kotlin
Vendored
35 lines
543 B
Kotlin
Vendored
class TestClass {
|
|
<caret>
|
|
}
|
|
|
|
// EXIST: abstract
|
|
// EXIST: annotation
|
|
// EXIST: class
|
|
// EXIST: enum
|
|
// EXIST: final
|
|
// EXIST: fun
|
|
// EXIST: in
|
|
/*why?*/
|
|
// EXIST: inner
|
|
// EXIST: internal
|
|
// EXIST: object
|
|
// EXIST: open
|
|
// EXIST: out
|
|
/*why?*/
|
|
// EXIST: reified
|
|
/*why?*/
|
|
// EXIST: override
|
|
// EXIST: private
|
|
// EXIST: protected
|
|
// EXIST: public
|
|
// EXIST: interface
|
|
// EXIST: val
|
|
// EXIST: var
|
|
// EXIST: vararg
|
|
/*why?*/
|
|
// EXIST: constructor
|
|
// EXIST: init
|
|
// EXIST: companion object
|
|
// EXIST: sealed
|
|
// NOTHING_ELSE
|