mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-17 04:35:13 +07:00
sealed types: highlighting basics (IJP-571)
GitOrigin-RevId: 362c7ea743e31eb2d27b73552534f2627991b602
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8e8c9ed536
commit
6a1257e1a2
+15
@@ -0,0 +1,15 @@
|
||||
//classes
|
||||
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 E extends A {}
|
||||
<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 {}
|
||||
|
||||
//interfaces
|
||||
sealed interface IA permits IB, IC {}
|
||||
final class IB implements IA {}
|
||||
sealed interface IC extends IA {}
|
||||
class ICSameFile implements IC {}
|
||||
Reference in New Issue
Block a user