File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff 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`.
You can’t perform that action at this time.
0 commit comments