File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -1735,7 +1735,7 @@ object SymDenotations {
1735
1735
c.ensureCompleted()
1736
1736
end completeChildrenIn
1737
1737
1738
- if is(Sealed ) || isAllOf(JavaEnum ) && isClass then
1738
+ if ( is(Sealed ) || is( Private ) || isAllOf(JavaEnum ) ) && isClass then
1739
1739
if ! is(ChildrenQueried ) then
1740
1740
// Make sure all visible children are completed, so that
1741
1741
// they show up in Child annotations. A possible child is visible if it
Original file line number Diff line number Diff line change @@ -975,7 +975,7 @@ class Namer { typer: Typer =>
975
975
val sym = denot.symbol
976
976
977
977
def register (child : Symbol , parentCls : ClassSymbol ) = {
978
- if (parentCls.is(Sealed ))
978
+ if (parentCls.is(Sealed ) || parentCls.is( Private ) )
979
979
if ((child.isInaccessibleChildOf(parentCls) || child.isAnonymousClass) && ! sym.hasAnonymousChild)
980
980
addChild(parentCls, parentCls)
981
981
else if (! parentCls.is(ChildrenQueried ))
Original file line number Diff line number Diff line change
1
+ //> using options -Werror
2
+
3
+ object Repro {
4
+ sealed abstract class Listener
5
+
6
+ final case class Empty ()
7
+ extends Listener
8
+
9
+ final case class Waiting (next : Promise )
10
+ extends Listener
11
+
12
+ def foo [A ](l : Listener ): Unit = {
13
+ l match {
14
+ case Empty () => ()
15
+ case w @ Waiting (_) => ()
16
+ }
17
+ }
18
+ }
19
+
20
+ sealed trait Promise
21
+
22
+ object Promise {
23
+
24
+ def apply (): Promise = new PromiseImpl ()
25
+
26
+ private abstract class PromiseBase extends Promise
27
+
28
+ private final class PromiseImpl () extends PromiseBase
29
+ }
You can’t perform that action at this time.
0 commit comments