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 @@ -680,7 +680,7 @@ trait Checking {
680680 case tp : ConstantType if exprPurity(tree) >= purityLevel => // ok
681681 case tp =>
682682 def isCaseClassApply (sym : Symbol ): Boolean =
683- sym.name == nme.apply && sym.owner.is(Module ) && sym.owner.companionClass.is(Case )
683+ sym.name == nme.apply && sym.is( Synthetic ) && sym. owner.is(Module ) && sym.owner.companionClass.is(Case )
684684 def isCaseClassNew (sym : Symbol ): Boolean =
685685 sym.isPrimaryConstructor && sym.owner.is(Case ) && sym.owner.isStatic
686686 def isCaseObject (sym : Symbol ): Boolean = {
@@ -691,7 +691,7 @@ trait Checking {
691691 ctx.erasedTypes ||
692692 ctx.inInlineMethod ||
693693 (tree.symbol.isStatic && isCaseObject(tree.symbol) || isCaseClassApply(tree.symbol)) ||
694- (tree.symbol.owner.isStatic && isCaseClassNew(tree.symbol) )
694+ isCaseClassNew(tree.symbol)
695695 if (! allow) ctx.error(em " $what must be a known value " , tree.pos)
696696 else {
697697 def checkArgs (tree : Tree ): Unit = tree match {
You can’t perform that action at this time.
0 commit comments