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

[ConstraintSystem] Detect and diagnose missing 'each' and provide a fix-it #65718

Merged
merged 4 commits into from
May 15, 2023

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 5, 2023

Diagnose situations where value pack is referenced without an explicit 'each':

func compute<each T>(_: repeat each T) {}

func test<each T>(v: repeat each T) {
  repeat compute(v) // should be `repeat compute(each v)`
}

@xedin
Copy link
Contributor Author

xedin commented May 5, 2023

@swift-ci please build toolchain macOS

@xedin
Copy link
Contributor Author

xedin commented May 8, 2023

@swift-ci please test

xedin added 4 commits May 8, 2023 13:30
This is going to help us identify and fix positions were 'each'
keyword is mising.
Diagnose situations where value pack is referenced without an explicit 'each':

```
func compute<each T>(_: repeat each T) {}

func test<each T>(v: repeat each T) {
  repeat compute(v) // should be `repeat compute(each v)`
}
```
…ference

Detect that a value pack is missing 'each' keyword during constraint
generation and fix-it by injecting `PackElementExpr`.
@xedin xedin force-pushed the diagnose-missing-each-in-expr-context branch from 1ad71ee to e3d1317 Compare May 8, 2023 20:31
@xedin
Copy link
Contributor Author

xedin commented May 8, 2023

Dropped the change pack type -> type pack.

@xedin
Copy link
Contributor Author

xedin commented May 8, 2023

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented May 15, 2023

@swift-ci please smoke test macOS platform

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