java sealed types: check sealed class inheritors (IDEA-243536)

GitOrigin-RevId: 0390d8db04b10b8d5c1206987877d6356a93d535
This commit is contained in:
Anna Kozlova
2020-06-16 17:13:07 +03:00
committed by intellij-monorepo-bot
parent ed160cbeeb
commit 7d2384271f
4 changed files with 29 additions and 1 deletions
@@ -3,7 +3,7 @@ sealed class A permits B {}
sealed class B extends A permits C, D {}
final class C extends B {}
non-sealed class D extends B {}
class <error descr="sealed, non-sealed or final modifiers expected">E</error> extends A {}
class E extends <error descr="E is not allowed in the sealed hierarchy">A</error> {}
<error descr="Illegal combination of modifiers: 'sealed' and 'sealed'">sealed</error> <error descr="Illegal combination of modifiers: 'sealed' and 'sealed'">sealed</error> class SealedSealed {}
<error descr="Illegal combination of modifiers: 'sealed' and 'non-sealed'">sealed</error> <error descr="Illegal combination of modifiers: 'non-sealed' and 'sealed'">non-sealed</error> class SealedNonSealed {}
<error descr="Illegal combination of modifiers: 'sealed' and 'final'">sealed</error> <error descr="Illegal combination of modifiers: 'final' and 'sealed'">final</error> class SealedFinal {}