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

dotc ignores deprecatedName #19077

Open
som-snytt opened this issue Nov 25, 2023 · 1 comment · May be fixed by #19086
Open

dotc ignores deprecatedName #19077

som-snytt opened this issue Nov 25, 2023 · 1 comment · May be fixed by #19086

Comments

@som-snytt
Copy link
Contributor

Compiler version

3.4.0-RC1-bin-SNAPSHOT-git-3b974c5

Minimized code

Welcome to Scala 3.4.0-RC1-bin-SNAPSHOT-git-3b974c5 (21, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> def f(@deprecatedName x: Int) = x*2
def f(x: Int): Int

scala> f(x=21)
val res0: Int = 42

scala> def f(@deprecatedName("y") x: Int) = x*2
def f(x: Int): Int

scala> f(y=21)
-- Error: --------------------------------------------------------------------------------------------------------------
1 |f(y=21)
  |  ^^^^
  |  method f: (x: Int): Int does not have a parameter y
1 error found

Expectation

Welcome to Scala 2.13.12 (OpenJDK 64-Bit Server VM, Java 21).
Type in expressions for evaluation. Or try :help.

scala> def f(@deprecatedName x: Int) = x*2
def f(x: Int): Int

scala> f(x=21)
          ^
       warning: naming parameter x is deprecated.
val res0: Int = 42

scala> def f(@deprecatedName("y") x: Int) = x*2
def f(x: Int): Int

scala> f(y=21)
          ^
       warning: the parameter name y is deprecated: use x instead
val res1: Int = 42

Perhaps Dotty hasn't been around long enough for anyone to change a parameter name.

This means it doesn't respect

scala> locally(x = 42)
                 ^
       warning: naming parameter x is deprecated.
val res0: Int = 42
@som-snytt som-snytt added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 25, 2023
@som-snytt
Copy link
Contributor Author

I had not noticed the related #19002

otherwise I would have been mentally prepared to find this unimplemented.

@som-snytt som-snytt added area:annotations and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 26, 2023
@hamzaremmal hamzaremmal linked a pull request Nov 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant