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

Span includes trailing comma #16872

Closed
tgodzik opened this issue Feb 9, 2023 · 4 comments · Fixed by #20445
Closed

Span includes trailing comma #16872

tgodzik opened this issue Feb 9, 2023 · 4 comments · Fixed by #20445
Labels
area:positions itype:bug Spree Suitable for a future Spree

Comments

@tgodzik
Copy link
Contributor

tgodzik commented Feb 9, 2023

Compiler version

3.3.0-RC2

Minimized code

  for {
    a <- List(1)
    b <- List(a)
    if (
      a,
      b,
    ) == (1, 2)
 } yield b

Output

second b's span will include the trailing coma. This shows up both when using Interactive as well in semanticdb

Expectation

Trailing coma is excluded from span

@tgodzik tgodzik added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 9, 2023
@SethTisue SethTisue changed the title Span includes trailing coma Span includes trailing comma Feb 9, 2023
@jchyb jchyb added area:positions and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 10, 2023
@SethTisue SethTisue added the Spree Suitable for a future Spree label Jun 9, 2023
@SethTisue
Copy link
Member

@bishabosha @anatoliykmetyuk didn't one of you spend some time looking at this last week...?

@bishabosha
Copy link
Member

I had a look with someone at the Scala Spree in San Francisco but no results :)

@mbovel
Copy link
Member

mbovel commented May 20, 2024

This issue is still present as of 3.5.0 at 8563571.

def Test =
 for {
    a <- List(1)
    b <- List(a)
    if (
      a,
      b,
    ) == (1, 2)
 } yield b
scalac -Xprint:typer -Yprint-pos -Ydebug-pos test.scala
...
                    test.scala<67..67>([email protected]<67..68>,
                    [email protected]<76..78>)@test.scala<59..84>.==@
...

@mbovel
Copy link
Member

mbovel commented May 20, 2024

This issue was picked for the Scala Issue Spree of tomorrow, May 21st. @dwijnand, @rochala, @jan-pieter, @nmcb will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:positions itype:bug Spree Suitable for a future Spree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants