Skip to content

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

Closed
@fgoret

Description

@fgoret

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions