Skip to content

Commit

Permalink
Merge pull request #52 from lrytz/copyDefaults
Browse files Browse the repository at this point in the history
copy only has defaults in the first parameter list
  • Loading branch information
odersky committed Sep 23, 2013
2 parents 2484561 + ecd41b6 commit 710aed0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions documentation/src/reference/ReferencePart.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3666,15 +3666,16 @@ \subsection{Case Classes}
object instead.
A method named \code{copy} is implicitly added to every case class unless the
class already has a member (directly defined or inherited) with that name. The
method is defined as follows:
class already has a member (directly defined or inherited) with that name, or the
class has a repeated parameter. The method is defined as follows:
\begin{lstlisting}
def copy[$\tps\,$]($\ps'_1\,$)$\ldots$($\ps'_n$): $c$[$\tps\,$] = new $c$[$\Ts\,$]($\xs_1\,$)$\ldots$($\xs_n$)
\end{lstlisting}
Again, $\Ts$ stands for the vector of types defined in the type parameter section $\tps$
and each $\xs_i$ denotes the parameter names of the parameter section $\ps'_i$. Every value
parameter $\ps'_{i,j}$ of the \code{copy} method has the form \lstinline@$x_{i,j}$:$T_{i,j}$=this.$x_{i,j}$@,
where $x_{i,j}$ and $T_{i,j}$ refer to the name and type of the corresponding class parameter
and each $\xs_i$ denotes the parameter names of the parameter section $\ps'_i$. The value
parameters $\ps'_{1,j}$ of first parameter list have the form \lstinline@$x_{1,j}$:$T_{1,j}$=this.$x_{1,j}$@,
the other parameters $\ps'_{i,j}$ of the \code{copy} method are defined as \lstinline@$x_{i,j}$:$T_{i,j}$@.
In all cases $x_{i,j}$ and $T_{i,j}$ refer to the name and type of the corresponding class parameter
$\ps_{i,j}$.
Every case class implicitly overrides some method definitions of class
Expand Down

0 comments on commit 710aed0

Please sign in to comment.