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

Deeply focus the qualifier before using it as the RHS of the stabilizing val. #6322

Merged
merged 1 commit into from Feb 28, 2018

Conversation

hrhino
Copy link
Member

@hrhino hrhino commented Feb 13, 2018

...because rangepos expects offset-positioned trees not to contain range-positioned trees. This is the same approach that default arguments use when moving the RHS of the parameter val into a default getter.

Alternatives:

  • Remove that assertion: I'm not sure what it's for, but the validation seems quite insistent on that point. I suspect that the IDE or PC or something using positions may break on that.
  • Use the tree duplicator (and don't make a focuser traverser). This is how the default args are currently done, but since we're not reusing qual here that I can see it doesn't seem too useful to waste the allocations that it would take to duplicate that tree.

The test cases are just slapping -Yrangepos on all of the test cases introduced in bcbe993 (where this feature was introduced).

test/files/pos/t4225.scala is not thus enhanced, since there's a similar rangeposly error with by-name arguments of right-associative methods.

Fixes scala/bug#10706, references scala/scala-dev#472.

…ing val.

...because rangepos expects offset-positioned trees not to
contain range-positioned trees. This is the same approach that
default arguments use when moving the RHS of the parameter val
into a default getter.

Alternatives:
- Remove that assertion: I'm not sure what it's for, but the
  validation seems quite insistent on that point. I suspect
  that the IDE or PC or something using positions may break
  on that.
- Use the tree duplicator (and don't make a focuser traverser).
  This is how the default args are currently done, but since
  we're not reusing `qual` here that I can see it doesn't seem
  too useful to waste the allocations that it would take to
  duplicate that tree.

The test cases are just slapping `-Yrangepos` on all of the
test cases introduced in bcbe993 (where this feature was
introduced).

`test/files/pos/t4225.scala` is not thus enhanced, since
there's a similar rangeposly error with by-name arguments
of right-associative methods.

Fixes scala/bug#10706.
@scala-jenkins scala-jenkins added this to the 2.13.0-M4 milestone Feb 13, 2018
@hrhino
Copy link
Member Author

hrhino commented Feb 13, 2018

/sync

(this didn't report back on a successful build immediately, but /sync seemed to work)

@lrytz
Copy link
Member

lrytz commented Feb 28, 2018

Thank you!

@lrytz
Copy link
Member

lrytz commented Feb 28, 2018

Filed scala/bug#10751 for the right-associative by-name combo.

@hrhino
Copy link
Member Author

hrhino commented Feb 28, 2018

Thank you!

@hrhino hrhino deleted the t10706 branch February 28, 2018 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants