Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy only has defaults in the first parameter list #52

Merged
merged 1 commit into from
Sep 23, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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