Skip to content

Don't expand name of ctor default arg #23478

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jul 5, 2025

Fixes #23477

The primary constructor is private, so that the default arg is private in the companion module.

Default arg access must be widened because it is used from the auxiliary constructor.

Normally, this requires mangling the member name. Since the mangling was not encoded correctly, it can just use the existing name with the standard encoding (which ensures no conflicts; constructors are not inherited and overloads cannot both define defaults).

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.

Compiler crashes on private constructor with default argument when running with -Ycheck:all
1 participant