Skip to content

Commit 3d69d05

Browse files
committed
Adopt review suggestions
1 parent 7d0ab6f commit 3d69d05

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,8 +1811,11 @@ class Typer extends Namer
18111811
checkDerivedValueClass(cls, body1)
18121812

18131813
val effectiveOwner = cls.owner.skipWeakOwner
1814-
if cls.is(CaseClass) && effectiveOwner.is(Trait) && !effectiveOwner.derivesFrom(defn.ObjectClass)
1815-
ctx.error(i"case $cls cannot be defined in universal $effectiveOwner", cdef.sourcePos)
1814+
if !cls.isRefinementClass
1815+
&& !cls.isAllOf(PrivateLocal)
1816+
&& effectiveOwner.is(Trait)
1817+
&& !effectiveOwner.derivesFrom(defn.ObjectClass)
1818+
ctx.error(i"$cls cannot be defined in universal $effectiveOwner", cdef.sourcePos)
18161819

18171820
// Temporarily set the typed class def as root tree so that we have at least some
18181821
// information in the IDE in case we never reach `SetRootTree`.

0 commit comments

Comments
 (0)