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
1811
1811
checkDerivedValueClass(cls, body1)
1812
1812
1813
1813
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)
1816
1816
1817
1817
// Temporarily set the typed class def as root tree so that we have at least some
1818
1818
// information in the IDE in case we never reach `SetRootTree`.
You can’t perform that action at this time.
0 commit comments