Skip to content

Canonicalize different spellings of the same integer generic parameter. #80519

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

Merged

Conversation

jckarter
Copy link
Contributor

@jckarter jckarter commented Apr 4, 2025

Foo<256>, Foo<2_56>, and Foo<0x100> are all canonically the same type. Fixes rdar://144736386.

`Foo<256>`, `Foo<2_56>`, and `Foo<0x100>` are all canonically the same type.
Fixes rdar://144736386.
@jckarter
Copy link
Contributor Author

jckarter commented Apr 4, 2025

@swift-ci Please test

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

Do we really want sugared integers to exist at all?

@jckarter
Copy link
Contributor Author

jckarter commented Apr 4, 2025

I don't see a strong argument against keeping the sugar, since it's good for diagnostics to preserve the spelling from source so long as a value is canonically equivalent with other representations of the same value.

@jckarter jckarter merged commit b4fb529 into swiftlang:main Apr 4, 2025
5 checks passed
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