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

"super" bug in 3.3.0-RC3 - "missing argument for parameter" #17008

Closed
jpsacha opened this issue Feb 24, 2023 · 2 comments · Fixed by #17058
Closed

"super" bug in 3.3.0-RC3 - "missing argument for parameter" #17008

jpsacha opened this issue Feb 24, 2023 · 2 comments · Fixed by #17058
Assignees
Labels
area:default-parameters itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@jpsacha
Copy link

jpsacha commented Feb 24, 2023

Code that compiled with previous versions of Scala (3.2.2, 3.0.2, 2.13.10, 2.12.17) no longer compiles in 3.3.0-RC3, but removing super. makes it compile in 3.3.0-RC3

Compiler version

3.3.0-RC3

Minimized code

abstract class A {
  protected def foo(text: String, bar: () => Unit = () => ()): Unit = println(s"$text, $bar")
}

class B extends A {
  def f1(): Unit = {
    super.foo("X")
  }
}

Compiler error:

missing argument for parameter bar of method foo in class A: (text: String, bar: () => Unit): Unit

A "workaround" - remove .super - replace:

super.foo("X")

with

foo("X")

that will make the code compile

@jpsacha jpsacha added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 24, 2023
@Kordyjan Kordyjan added regression This worked in a previous version but doesn't anymore area:default-parameters and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 27, 2023
@Kordyjan Kordyjan added this to the 3.3.0 backports milestone Feb 27, 2023
@dwijnand
Copy link
Member

Should be fixed by #16977

@odersky
Copy link
Contributor

odersky commented Mar 6, 2023

@dwijnand Can you check that it is fixed, and add a regression test?

@dwijnand dwijnand linked a pull request Mar 7, 2023 that will close this issue
@Kordyjan Kordyjan modified the milestones: 3.3.0 backports, 3.3.1 Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:default-parameters itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants