Skip to content

Conversation

@dwijnand
Copy link
Member

@dwijnand dwijnand commented Mar 8, 2024

Closes #19823 (in as much as we can fix, see my last comment on the issue)

@dwijnand dwijnand marked this pull request as ready for review March 11, 2024 11:50
@dwijnand dwijnand requested a review from smarter March 11, 2024 11:50
@dwijnand
Copy link
Member Author

@smarter I'm not sure if this is a good idea. I only kept it and submitted it because it fixes and issue and it avoids work. And I think it can be justified under "I said hard union so don't widen" expectations.

@smarter
Copy link
Member

smarter commented Apr 4, 2024

Hmm, so this kind of goes in the opposite direction of the just merged 5bf3227, it seems that what's important in the code sample is that the user explicitly wrote B.type and so it's the enum type itself which is "hard" here and shouldn't be widened, the fact that a hard union is also present is incidental I think. I suggested an alternative fix in #19823 (comment)

@dwijnand dwijnand closed this Sep 25, 2024
@dwijnand dwijnand deleted the widen-hard-union branch September 25, 2024 22:30
@dwijnand dwijnand restored the widen-hard-union branch September 25, 2024 22:30
@dwijnand dwijnand deleted the widen-hard-union branch September 25, 2024 22:30
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.

Unexpected widening of hard union of enum val cases to the enum class.

2 participants