Skip to content

Inconsistent range position for selection from parens #12490

@lrytz

Description

@lrytz

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions