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

Export clauses don't forward the default values of function's parameters #14020

Closed
fgoret opened this issue Dec 1, 2021 · 0 comments · Fixed by #14051
Closed

Export clauses don't forward the default values of function's parameters #14020

fgoret opened this issue Dec 1, 2021 · 0 comments · Fixed by #14051
Assignees
Milestone

Comments

@fgoret
Copy link
Contributor

fgoret commented Dec 1, 2021

Compiler version 3.1.1-RC1

Minimized code

class A:
  def greeting(name: String = "you") = s"Hello $name"

class B:
  val a = A()
  export a.*

val b = B()

b.a.greeting()      // works
b.greeting("John")  // works
b.greeting()        // nope !

Output

the call of b.greeting() gives a compilation error:
missing argument for parameter name of method greeting in class B: (name: String): String

Expectation

should have b.a.greeting() and b.greeting() be equivalent, i.e. b.gretting() should know about the default value of it's parameter.

odersky added a commit to dotty-staging/dotty that referenced this issue Dec 6, 2021
@odersky odersky assigned bishabosha and odersky and unassigned bishabosha Dec 6, 2021
odersky added a commit to dotty-staging/dotty that referenced this issue Dec 7, 2021
odersky added a commit to dotty-staging/dotty that referenced this issue Dec 10, 2021
olsdavis pushed a commit to olsdavis/dotty that referenced this issue Apr 4, 2022
@Kordyjan Kordyjan added this to the 3.1.2 milestone Aug 2, 2023
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.

4 participants