Skip to content

[Parse] Fix type parsing when preceded by '-' #76404

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
merged 1 commit into from
Sep 12, 2024

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented Sep 11, 2024

It was mentioned post merge in this PR #75518 that we accept parsing types as -Int now and these go undiagnosed. This patch fixes that to only parse - if it is preceded by an integer literal for integer type parsing. This also fixes an issue when same type constraining a type parameter to an integer type which previously would give diagnostics, for example, about the type 1 not conforming to Copyable or Escapable which is a pretty poor diagnostic.

@Azoy
Copy link
Contributor Author

Azoy commented Sep 11, 2024

@swift-ci please test

@Azoy Azoy merged commit 718bba4 into swiftlang:main Sep 12, 2024
5 checks passed
@Azoy Azoy deleted the integer-type-parsing-fixes branch September 12, 2024 16:27
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.

1 participant