Skip to content

Incorect location for diagnostic on repeated modifier #17981

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

Closed
ckipp01 opened this issue Jun 15, 2023 · 0 comments · Fixed by #17982
Closed

Incorect location for diagnostic on repeated modifier #17981

ckipp01 opened this issue Jun 15, 2023 · 0 comments · Fixed by #17982
Assignees
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug
Milestone

Comments

@ckipp01
Copy link
Member

ckipp01 commented Jun 15, 2023

Compiler version

3.3.2-RC1-bin-20230614-302be2f-NIGHTLY-git-302be2f

Minimized code

final final case class Foo()

Output

scala> final final case class Foo()
-- [E015] Syntax Error: --------------------------------------------------------
1 |final final case class Foo()
  |            ^^^^^
  |            Repeated modifier final
  |
  | longer explanation available when compiling with `-explain`

I also originally noticed this when trying the action shown in here since the code action was only able to be triggered when I was on class instead of final.

Expectation

I would expect that the ^^^ location and the actual diagnostic range to be covering the final modifiers since that's where the issue actual is.

@ckipp01 ckipp01 added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 15, 2023
@ckipp01 ckipp01 self-assigned this Jun 15, 2023
ckipp01 added a commit to ckipp01/dotty that referenced this issue Jun 15, 2023
Currently given the following code snippet:

```scala
final final case class Foo()
```

The error is reported on `Foo` and not on the repeated modifier. This
change change the reporting to instead report on the repeated modifier
`final`.

Fixes scala#17981
@ckipp01 ckipp01 added area:reporting Error reporting including formatting, implicit suggestions, etc and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 15, 2023
ckipp01 added a commit that referenced this issue Jun 19, 2023
Currently given the following code snippet:

```scala
final final case class Foo()
```

The error is reported on `Foo` and not on the repeated modifier. This
changes the reporting to instead report on the repeated modifier
`final`.

Fixes #17981
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 2023
Kordyjan pushed a commit that referenced this issue Nov 23, 2023
Currently given the following code snippet:

```scala
final final case class Foo()
```

The error is reported on `Foo` and not on the repeated modifier. This
changes the reporting to instead report on the repeated modifier
`final`.

Fixes #17981
[Cherry-picked 10180da]
Kordyjan pushed a commit that referenced this issue Nov 29, 2023
Currently given the following code snippet:

```scala
final final case class Foo()
```

The error is reported on `Foo` and not on the repeated modifier. This
changes the reporting to instead report on the repeated modifier
`final`.

Fixes #17981
[Cherry-picked 10180da]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants