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

Remove TypeOf*Type for types whose type-of-type can just be Type #2302

Merged
merged 6 commits into from
Oct 18, 2022

Conversation

zygoloid
Copy link
Contributor

We don't seem to have any need for TypeOf*Type types, and having them introduces the temptation to use them during type-checking, which would lead to types having different behavior when their type-of-type is Type versus when it's a more precise type. Remove these types for now.

If we later decide that we want each type literal to have a unique type, as we do for value literals, we can introduce a single value kind for that rather than one for each kind of type.

No changes to TypeOfMemberName, TypeOfParameterizedEntityName, and TypeOfMixinPseudoType, which are placeholders, not real types.

@zygoloid zygoloid added the explorer Action items related to Carbon explorer code label Oct 18, 2022
@zygoloid zygoloid requested a review from jonmeow October 18, 2022 05:17
Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

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

FWIW, I'm mixed on this idea (including the enum as mentioned in the PR) because it seems like it restricts the ability to perform reflection (i.e., performing different kinds of lookup on a choice, class, generic class, interface, etc). However, I'm taking this as a leads decision that reflection shouldn't be implemented in that way.

@zygoloid zygoloid merged commit 561e450 into carbon-language:trunk Oct 18, 2022
@zygoloid zygoloid deleted the explorer-remove-unique-types branch October 18, 2022 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
explorer Action items related to Carbon explorer code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants