-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix Tasty reflect with varargs in unapply #4877
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
Fix Tasty reflect with varargs in unapply #4877
Conversation
98a03ea
to
5e352e7
Compare
case _ => None | ||
} | ||
private def effectivePatterns(patterns: List[Pattern]): List[Pattern] = patterns match { | ||
case patterns0 :+ Trees.SeqLiteral(elems, _) => patterns0 ::: elems | ||
case _ => patterns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that patterns
only contain SeqLiteral
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the last one can one can have the SeqLiteral
as only the last argument can be a varargs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It's nice to have a link to test case here, as it's really difficult to figure out the test case
- The code fails to handle the following case:
case class D(b: B[_]*)
class Test {
def f2(d: D) = d match {
case D(a, b1, b2) => ()
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, LGTM
case _ => None | ||
} | ||
private def effectivePatterns(patterns: List[Pattern]): List[Pattern] = patterns match { | ||
case patterns0 :+ Trees.SeqLiteral(elems, _) => patterns0 ::: elems | ||
case _ => patterns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It's nice to have a link to test case here, as it's really difficult to figure out the test case
- The code fails to handle the following case:
case class D(b: B[_]*)
class Test {
def f2(d: D) = d match {
case D(a, b1, b2) => ()
}
}
c0edcb6
to
457b554
Compare
No description provided.