-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Exporting a method with a different name drops the default parameters #19587
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
Comments
this is definitely a bug, here is output with final lazy module val Test2: Test2 = new Test2()
final module class Test2() extends Object() { this: Test2.type =>
export Foo.{withDefaults as fooWithDefaults}
final def fooWithDefaults(bar: String, baz: Int): Foo =
Foo.withDefaults(bar, baz)
final def withDefaults$default$1: String @uncheckedVariance =
Foo.withDefaults$default$1
final def withDefaults$default$2: Int @uncheckedVariance =
Foo.withDefaults$default$2
} |
We've noticed the same problem in Besom on Monday where we export methods from internals to the public API. Defaults are gone after the export, even method signature hint from PC shows there are no defaults. |
So it seems |
I could reproduce only the OP. I added infix to the test just for regression. |
Fixes #19587 The default arg getter for the forwarder needs the export alias name.
Compiler version
Scala 3.3.1
Minimized code
Output
Expectation
Same behavior as
Test1
, renaming should have no effect on the default values of the methods.I did't find any mention of this in the documentation so, I don't know if this is a design choice to avoid collisions and other problems or it's a bug.
The text was updated successfully, but these errors were encountered: