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

Inconsistent range position for selection from parens #12490

Closed
lrytz opened this issue Nov 11, 2021 · 0 comments
Closed

Inconsistent range position for selection from parens #12490

lrytz opened this issue Nov 11, 2021 · 0 comments
Assignees
Milestone

Comments

@lrytz
Copy link
Member

lrytz commented Nov 11, 2021

The range position for a selection (foo).bar doesn't include the leading (, which seems inconsistent.

class A { def t       = new C()   } // 24:31                                                  // 99
class B { def t       = (new C)   } // 25:30                                                  // 99
class C { def t       = new C     } // 24:29                                                  // 99
class D { def t       = new C().t } // 24:33                                                  // 99
class E { def t       = (new C).t } // 25:33 << BAD                                           // 99
class F { def t(c: C) = c         } // 24:25                                                  // 99
class G { def t(c: C) = (c)       } // 25:26                                                  // 99
class H { def t(c: C) = c.t       } // 24:27                                                  // 99
class I { def t(c: C) = (c).t     } // 25:29 << BAD                                           // 99
//                      ^24      ^33

Positions are shown when compiling the above with -Yrangepos -Xprint:parser -Ypos-debug -Yshow-trees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant