Skip to content

[CSDiagnostics] Add an error message for pack expansion expressions over packs that don't have the same shape. #62729

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
Dec 21, 2022

Conversation

hborla
Copy link
Member

@hborla hborla commented Dec 21, 2022

For example:

func sameShapeDiagnostics<T..., U...>(t: T..., u: U...) {
  _ = (each t, each u)... // 't' and 'u' do not have the same shape
}

A ShapeOf constraint breaks down into a Bind. Previously if that failed, the constraint system would report type of expression is ambiguous without more context. Now, it reports pack expansion requires that 'U' and 'T' have the same shape.

@hborla hborla requested a review from xedin December 21, 2022 15:51
@hborla
Copy link
Member Author

hborla commented Dec 21, 2022

@swift-ci please smoke test

@hborla hborla marked this pull request as ready for review December 21, 2022 16:03
@hborla hborla merged commit 0d3504f into swiftlang:main Dec 21, 2022
@hborla hborla deleted the pack-diagnostics branch December 21, 2022 18:44
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