Skip to content

[5.9][Sema] Improvements to variadic generics inference and diagnostics #65950

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

xedin
Copy link
Contributor

@xedin xedin commented May 16, 2023

@xedin xedin added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.9 labels May 16, 2023
@xedin xedin requested a review from hborla May 16, 2023 17:27
@xedin xedin requested a review from a team as a code owner May 16, 2023 17:27
@xedin
Copy link
Contributor Author

xedin commented May 16, 2023

@swift-ci please test

xedin added 5 commits May 17, 2023 09:25
…ix-it

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

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

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

(cherry picked from commit 31e0a52)
(cherry picked from commit 5836490)
(cherry picked from commit eee7e18)
(cherry picked from commit e3d1317)
…ashable conversion

Failure of an argument to AnyHashable parameter to conform to Hashable
protocol should be detected in `simplifyConformsToConstraint` and fixed
there.

Doing so requires impact assessment adjustment because regular conformance
requirements have default impact of 1, this is going to have argument
impact of 2 not avoid clashing with other failures.

Resolves: rdar://108977234

(cherry picked from commit 5f8e3eb)
(cherry picked from commit 58ffca8)
(cherry picked from commit 440bc39)
(cherry picked from commit 4a2d139)
(cherry picked from commit c9c6311)
…ck expansions to Void for closure result

Resolves: rdar://108904190

(cherry picked from commit effa261)
(cherry picked from commit dc4ee4b)
…d `Any`

Don't attempt to wrap `Any` into a single-element tuple to match
against a tuple with pack expansions, this conversion would be
handled by existential promotion if it's allowed, otherwise it
would produce an error.

Resolves: rdar://109160060
(cherry picked from commit 181d2d1)
@xedin xedin force-pushed the more-variadic-sema-improvements-5.9 branch from f671c9d to 2eff1cd Compare May 17, 2023 16:26
@xedin
Copy link
Contributor Author

xedin commented May 17, 2023

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants