-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #581: Add tests and adapt to named-base unapplySeq spec #5959
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
Conversation
def isEmpty = xs == null | ||
def get = xs |
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.
I'm guessing this change is needed because Array[T]
only defines length
apply
and drop
after implicit conversion to ArrayWrapper
, which dotty doesn't perform in that case...
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.
Yes, the new Spec requires toSeq
as well.
case TripleBippy(3 :: Nil, 3.0, 'b', chars : _*) => "1: " + chars | ||
case TripleBippy(5 :: Nil, 5.0, 'b' | 'B', chars : _*) => "2: " + chars | ||
case TripleBippy(_, _, chars : _*) => "3: " + chars | ||
case TripleBippy(3 :: Nil, 3.0, Bippy('b', chars : _*)) => "1: " + chars |
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.
Why do we need this change?
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.
Currently Dotty does not support TripleBippy
as it's written before. I agree this is not a proper fix. We need to decide whether or not to suppor the Scala2 behavior.
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.
Agreed. The spec is also inconsistent as it claims to support a super set of scalac 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.
Note that this test was changed in scala/scala@308ae2d#diff-f761b9d2bf9ec2f17bc00f552fc07314 when Scala 2.13 changed how name-based unapplySeq works: scala/scala#7068
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.
Thanks for the link @smarter 👍
Close in favor of #5989 |
Fix #581: Add tests and adapt to named-base unapplySeq spec