summaryrefslogtreecommitdiff
path: root/test/scaladoc
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-02-01 11:55:01 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-02-01 14:32:20 -0800
commit8ae0e2a37764e0193dccd5658fd35f56edcbfd69 (patch)
treeb6acda3ef9a17f330918a1fdee100f332a86be95 /test/scaladoc
parent09d143306432124db7b364034abd94792947231e (diff)
downloadscala-8ae0e2a37764e0193dccd5658fd35f56edcbfd69.tar.gz
scala-8ae0e2a37764e0193dccd5658fd35f56edcbfd69.tar.bz2
scala-8ae0e2a37764e0193dccd5658fd35f56edcbfd69.zip
SI-7039 unapplySeq result type independent of subpattern count
Fixes a bug in the implementation of the `unapplySeq` part of the spec below. An `unapply` method with result type `R` in an object `x` matches the pattern `x(p_1, ..., p_n)` if it takes exactly one argument and, either: - `n = 0` and `R =:= Boolean`, or - `n = 1` and `R <:< Option[T]`, for some type `T`. The argument pattern `p1` is typed in turn with expected type `T`. - Or, `n > 1` and `R <:< Option[Product_n[T_1, ..., T_n]]`, for some types `T_1, ..., T_n`. The argument patterns `p_1, ..., p_n` are typed with expected types `T_1, ..., T_n`. An `unapplySeq` method in an object `x` matches the pattern `x(p_1, ..., p_n)` if it takes exactly one argument and its result type is of the form `Option[S]`, where either: - `S` is a subtype of `Seq[U]` for some element type `U`, (set `m = 0`) - or `S` is a `ProductX[T_1, ..., T_m]` and `T_m <: Seq[U]` (`m <= n`). The argument patterns `p_1, ..., p_n` are typed with expected types `T_1, ..., T_m, U, ..., U`. Here, `U` is repeated `n-m` times.
Diffstat (limited to 'test/scaladoc')
0 files changed, 0 insertions, 0 deletions