-
Type:
Bug
-
Status: Resolved
-
Priority:
P3
-
Resolution: Duplicate
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: tools
-
Labels:
-
Subcomponent:
it is possible to define a sealed intf, and permitted subclass but can't be used
jshell> sealed interface Foo permits X {
...> public int x();
...> }
| created interface Foo, however, it cannot be referenced until class X is declaredjshell> class X implements Foo { public int x() { return 3; } }
| created class X, however, it cannot be referenced until class Foo is declaredjshell> new X()
| Error:
| cannot find symbol
| symbol: class X
| new X()
| ^
jshell> sealed interface Foo permits X {
...> public int x();
...> }
| created interface Foo, however, it cannot be referenced until class X is declaredjshell> class X implements Foo { public int x() { return 3; } }
| created class X, however, it cannot be referenced until class Foo is declaredjshell> new X()
| Error:
| cannot find symbol
| symbol: class X
| new X()
| ^
- duplicates
-
JDK-8246353 Sealed types not supported by jshell
-
- Resolved
-