Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented May 5, 2015

We used to require that the result type of an extractor get is a product,
or else the type of the get itself would be taken as the result type of the
unapply. This is now relaxed so that we automatically select with _1, _2, ...
as soon as there are multiple argument patterns, and (1) the result type is not
a Seq, (2) the number of consecutive product selectors matches the number
of arguments.

This should fix #537. Review by @DarkDimius

odersky added 2 commits May 5, 2015 22:38
We used to require that the result type of an extractor `get` is a product,
or else the type of the `get` itself would be taken as the result type of the
unapply. This is now relaxed so that we automatically select with _1, _2, ...
as soon as there are multiple argument patterns, and (1) the result type is not
a Seq, (2) the number of consecutive product conselectors matches the number
of arguments.
@DarkDimius
Copy link
Contributor

It did fix the issue. Thanks.
LGTM

DarkDimius added a commit that referenced this pull request May 6, 2015
Drop the requirement that extractors with `get` must implement Product
@DarkDimius DarkDimius merged commit 905c541 into scala:master May 6, 2015
@allanrenucci allanrenucci deleted the fix/#537-extractors branch December 14, 2017 19:21
tgodzik added a commit that referenced this pull request Aug 13, 2025
Backport "Emit an error for quoted pattern type variable after `new`" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dotty fails to type some patterns

2 participants