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

Commits on Feb 13, 2018

  1. Deeply focus the qualifier before using it as the RHS of the stabiliz…

    …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.
    hrhino committed Feb 13, 2018
    Configuration menu
    Copy the full SHA
    9de783c View commit details
    Browse the repository at this point in the history