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

fix: Account for the optional equality support of map/seq inside newtypes #5980

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RustanLeino
Copy link
Collaborator

This PR extends fix #5973 of issue #5972 to also handle newtypes, subset types, and type synonyms wrapped around map and sequence types.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

thingsChanged = true;
} else if (type.SupportsEquality) {
// nothing to do
} else if (type.Normalize() is UserDefinedType userDefinedType) {
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need this normalization? I thought that AsMapType and AsSeqType would actually do that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This type.Normalize() cuts through any type proxies that may be sitting around the UserDefinedType.

AsMapType and AsSeqType call NormalizeExpand(), which cuts through both proxies and type synonyms. But that's too much, because a type synonym can also have an explicit (==) declaration.

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.

2 participants