Skip to content

Conversation

@jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Oct 28, 2025

This is just reducing boilerplate in typed_insts.h because we have a number of singleton types, and keep adding more.

The changes to TemplateString allow TemplateString IrName to be used as a StringLiteral.

@jonmeow jonmeow requested a review from a team as a code owner October 28, 2025 22:59
@jonmeow jonmeow requested review from josh11b and removed request for a team October 28, 2025 22:59
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

Comment on lines +1970 to +1971
// This is a singleton instruction. However, it may still evolve into a more
// standard type and be removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

I've got a feeling at least half of these are just copy paste and don't actually make sense anymore, but I don't know what the comment means exactly so it's hard to say...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding what it means, I think zygoloid was thinking we'd want to construct them using more standard object representations, e.g. using TupleType, or perhaps just generating a bespoke type on demand, without a bespoke instruction.

I can't comment on whether TupleType is likely to happen, but I am mulling whether I can change these to eliminate the bespoke instructions, instead just having something like SingletonType that contains enough information to deduplicate itself.

@jonmeow jonmeow enabled auto-merge October 29, 2025 16:04
@jonmeow jonmeow added this pull request to the merge queue Oct 29, 2025
Merged via the queue into carbon-language:trunk with commit 93dc369 Oct 29, 2025
8 checks passed
@jonmeow jonmeow deleted the singleton-type-base branch October 29, 2025 17:37
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.

2 participants