Skip to content

Conversation

@jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Oct 28, 2025

This is to avoid edge cases where there are multiple ConstType instructions, which code may not handle appropriately. I was thinking about this for #6279

@jonmeow jonmeow requested a review from a team as a code owner October 28, 2025 19:12
@jonmeow jonmeow requested review from danakj and removed request for a team October 28, 2025 19:12
@jonmeow jonmeow changed the title Make repeated const have less effect. Make applying const repeatedly to the same type have less additional effect. Oct 28, 2025
Copy link
Contributor

@danakj danakj left a comment

Choose a reason for hiding this comment

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

LGTM

@danakj danakj added this pull request to the merge queue Oct 28, 2025
Merged via the queue into carbon-language:trunk with commit eed21f6 Oct 28, 2025
8 checks passed
@jonmeow jonmeow deleted the const-effect branch October 28, 2025 20:21
@zygoloid
Copy link
Contributor

zygoloid commented Nov 5, 2025

I don't think we should do this: if code doesn't handle nested ConstTypes incorrectly, it should be fixed.

Note that the constant value of the type already flattens multiple consts into a single const; this is only dropping the const from the "as-written" form of the type, making the (valid) SemIR not match the written form of the source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants