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

Avoid spurious recompilations when unrelated constructor with default argument changes #1324

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

Friendseeker
Copy link
Member

@Friendseeker Friendseeker commented Jan 3, 2024

Issue

Constructor sometimes has name <init>$default$number (e.g. <init>$default$1, <init>$default$2) instead of <init>. Hence two unrelated constructors have the same name.

#288 ensured that two unrelated <init> constructor have different names by prepending constructor name with class name, however #288 did not handle <init>$default$.

Fix

Prepend <init>$default$ with the class name.

c.c. #288, #578 (comment)

@Friendseeker
Copy link
Member Author

Friendseeker commented Jan 3, 2024

I am deliberating on whether the PR is actually a good change to have.

This particular case <init>$default$ is rare (unlike <init> which is always a used name), while the extra logic introduced by this PR adds overhead to all Def handling. It also makes API phase slightly more confusing.


I shall request for review and let reviewer determine if this is actually good to have.

@Friendseeker Friendseeker marked this pull request as ready for review January 3, 2024 19:10
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@eed3si9n eed3si9n merged commit cbddcc4 into sbt:develop Jan 3, 2024
8 checks passed
@Friendseeker Friendseeker deleted the this-context-dependent branch January 3, 2024 22:40
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.

2 participants