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

Incorrect position on first definition in multiple variable declaration #13067

Open
kasiaMarek opened this issue Dec 12, 2024 · 1 comment
Open
Assignees
Milestone

Comments

@kasiaMarek
Copy link

Reproduction steps

In the following code:

object O {
  val xx, yy, zz = 1
}

ValDef tree for x has incorrect position, the position is an offset instead of range.

Value definition positions:

  • xx - line-2,offset=17 //offset
  • yy - (21, 21, 31) //range
  • zz - (25, 25, 31) //range

Scala version: 2.13.15

Problem

I would expect the val def tree for xx to have a range position (17, 17, 31).

@som-snytt
Copy link

som-snytt commented Dec 12, 2024

I'll take a look, as I'm sure this syntax came up during previous postdoc research into positions.

Relevant
scala/scala#9355
and unmerged
scala/scala#9111
and
scala/scala#10740 (comment)
may be my most recent memory of the issue.

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

3 participants