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

Retain default parameters with export #20167

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

smarter
Copy link
Member

@smarter smarter commented Apr 11, 2024

Default parameters need to have the HasDefault flag set to work properly, it seems that without this flag they were still selected but only under join compilation.

While we're at it, we define a full set of flags that might be exported. Note that Given/Implicit/Erased were already set by tpd.DefDef and Inlined doesn't seem to make a difference in practice since the body of the exported inline def is manually constructed and doesn't contain proxies either way.

Default parameters need to have the `HasDefault` flag set to work properly, it
seems that without this flag they were still selected but only under join
compilation.

While we're at it, we define a full set of flags that might be exported. Note
that Given/Implicit/Erased were already set by `tpd.DefDef` and Inlined doesn't
seem to make a difference in practice since the body of the exported inline def
is manually constructed and doesn't contain proxies either way.
@aumann
Copy link

aumann commented Apr 12, 2024

Ist this perhaps a fix for #15031 ? (just remembering the issue and mentioning here for your convenience)

@smarter
Copy link
Member Author

smarter commented Apr 12, 2024

Yes, thank you!

@smarter smarter linked an issue Apr 12, 2024 that may be closed by this pull request
@odersky odersky merged commit fb15fe3 into scala:main Apr 13, 2024
19 checks passed
@odersky odersky deleted the silence-ext-override branch April 13, 2024 17:18
@smarter smarter added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Apr 13, 2024
smarter added a commit that referenced this pull request Apr 18, 2024
fix was implemented in #20167, so
close the issue with a test

fixes #17930
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
@WojciechMazur WojciechMazur removed the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Jul 1, 2024
WojciechMazur added a commit that referenced this pull request Jul 5, 2024
Backports #20167 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import exported function from another file lose default parameters
5 participants