Skip to content

Incorrect SemantiDB production of method signatures with shadowed parameters #23160

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

Open
MatthieuSLR9 opened this issue May 14, 2025 · 0 comments · May be fixed by #23161
Open

Incorrect SemantiDB production of method signatures with shadowed parameters #23160

MatthieuSLR9 opened this issue May 14, 2025 · 0 comments · May be fixed by #23161

Comments

@MatthieuSLR9
Copy link

MatthieuSLR9 commented May 14, 2025

Compiler version

scala version 3.7.2

Minimized code

class IncorrectScalaBehavior {
def foo(x: Int) = {val x: Boolean = true}
}

SemanticDB output

Summary:
Schema => SemanticDB v4
Uri => tests/pos/HelloWorld2.scala
Text => empty
Language => Scala
Symbols => 5 entries
Occurrences => 7 entries

Symbols:
empty/IncorrectScalaBehavior# => class IncorrectScalaBehavior extends Object { self: IncorrectScalaBehavior => +2 decls }
empty/IncorrectScalaBehavior#<init>(). => primary ctor (): IncorrectScalaBehavior
empty/IncorrectScalaBehavior#foo(). => method foo(val x: Boolean): Unit
empty/IncorrectScalaBehavior#foo().(x) => param x: Int
local0 => val local x: Boolean

Occurrences:
[0:6..0:28) <= empty/IncorrectScalaBehavior#
[1:2..1:2) <= empty/IncorrectScalaBehavior#<init>().
[1:6..1:9) <= empty/IncorrectScalaBehavior#foo().
[1:10..1:11) <= empty/IncorrectScalaBehavior#foo().(x)
[1:13..1:16) => scala/Int#
[1:25..1:26) <= local0
[1:28..1:35) => scala/Boolean#

Expectation

We expect this line
empty/IncorrectScalaBehavior#foo(). => method foo(val x: Boolean): Unit
to be
empty/IncorrectScalaBehavior#foo(). => method foo(x: Int): Unit

@MatthieuSLR9 MatthieuSLR9 added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels May 14, 2025
@MatthieuSLR9 MatthieuSLR9 changed the title Incorrect SemantiDB production of the method signature with shadowed parameters Incorrect SemantiDB production of method signatures with shadowed parameters May 14, 2025
@Gedochao Gedochao added area:tooling area:semanticdb and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants