Skip to content

Commit 7ff817d

Browse files
authored
Merge pull request scala#10497 from som-snytt/doc/8827-abstract-copy
Boost spec of copy for abstract case class
2 parents 714c2f8 + 632c847 commit 7ff817d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/05-classes-and-objects.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,9 +900,10 @@ The name of the `unapply` method is changed to `unapplySeq` if the first
900900
parameter section ´\mathit{ps}_1´ of ´c´ ends in a
901901
[repeated parameter](04-basic-declarations-and-definitions.html#repeated-parameters).
902902

903-
A method named `copy` is implicitly added to every case class unless the
904-
class already has a member (directly defined or inherited) with that name, or the
905-
class has a repeated parameter. The method is defined as follows:
903+
A method named `copy` is implicitly added to every case class, unless the
904+
class already has a member with that name, whether directly defined or inherited.
905+
The `copy` method is also omitted if the class is abstract, or if the class has
906+
a repeated parameter. The method is defined as follows:
906907

907908
```scala
908909
def copy\mathit{tps}\,´](´\mathit{ps}'_1\,´)´\ldots´(´\mathit{ps}'_n´): ´c´[´\mathit{tps}\,´] = new ´c´[´\mathit{Ts}\,´](´\mathit{xs}_1\,´)´\ldots´(´\mathit{xs}_n´)

0 commit comments

Comments
 (0)