Skip to content

Commit 879854d

Browse files
committed
Don't change the return type of the copy method
`copy` should always return the type of it's rhs. The discussion of #1970 concluded that no special treatment for enums is needed.
1 parent ecf5b87 commit 879854d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ object desugar {
391391
cpy.ValDef(vparam)(rhs = copyDefault(vparam)))
392392
val copyRestParamss = derivedVparamss.tail.nestedMap(vparam =>
393393
cpy.ValDef(vparam)(rhs = EmptyTree))
394-
DefDef(nme.copy, derivedTparams, copyFirstParams :: copyRestParamss, applyResultTpt, creatorExpr)
394+
DefDef(nme.copy, derivedTparams, copyFirstParams :: copyRestParamss, TypeTree(), creatorExpr)
395395
.withMods(synthetic) :: Nil
396396
}
397397

0 commit comments

Comments
 (0)