File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1811,8 +1811,8 @@ class Typer extends Namer
18111811 checkDerivedValueClass(cls, body1)
18121812
18131813 val effectiveOwner = cls.owner.skipWeakOwner
1814- if ! cls.isRefinementClass && effectiveOwner.is(Trait ) && ! effectiveOwner.derivesFrom(defn.ObjectClass )
1815- ctx.error(i " class $cls cannot be defined in universal $effectiveOwner" , cdef.sourcePos)
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)
18161816
18171817 // Temporarily set the typed class def as root tree so that we have at least some
18181818 // information in the IDE in case we never reach `SetRootTree`.
You can’t perform that action at this time.
0 commit comments