Skip to content

Introduce type sugar for InlineArray #80087

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 5 commits into from
Mar 23, 2025

Conversation

hamishknight
Copy link
Contributor

Parse e.g [3 x Int] as type sugar for InlineArray. Gated behind an experimental feature flag for now.

@hamishknight hamishknight requested a review from Azoy March 18, 2025 20:12
Previously we would try the contextual type `(<int>, <element>)`,
which is wrong. Given we want to eliminate shrink, let's just bail.
Make sure it's called for sugar code paths too. Also let's just always
run it since it should be a pretty cheap check.
This was previously missed, though would have been diagnosed later
as a requirement failure.
While here, address the FIXME in `canParseTypeSimpleOrComposition`
and only check to see if we can parse a type-simple, including
`each`, `some`, and `any` for better recovery.
Parse e.g `[3 x Int]` as type sugar for InlineArray. Gated behind
an experimental feature flag for now.
@hamishknight
Copy link
Contributor Author

@airspeedswift airspeedswift merged commit f8ab391 into swiftlang:main Mar 23, 2025
5 checks passed
@hamishknight hamishknight deleted the inline-array-type branch March 24, 2025 01:08
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.

5 participants