Skip to content

[5.3][ConstraintSystem] Detect and diagnose inability to infer type of clo… #31810

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
May 15, 2020

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 15, 2020

…sure parameter(s)

Cherry-pick of #31809


  • Explanation:

Detect situation when it's impossible to determine types for
closure parameters used in the body from the context. E.g.
when a call closure is associated with refers to a missing
member.

struct S {
}

S.foo { a, b in } // `S` doesn't have static member `foo`

let _ = { v in } // not enough context to infer type of `v`

_ = .foo { v in } // base type for `.foo` couldn't be determined
  • Scope: Diagnostics related to parameters of a closure

  • Resolves: rdar://problem/63230293

  • Risk: Low

  • Testing: Added a regression tests

  • Reviewer: @hborla

Resolves: SR-12815
Resolves: rdar://problem/63230293

@xedin xedin added the r5.3 label May 15, 2020
@xedin xedin requested a review from a team as a code owner May 15, 2020 08:24
@xedin
Copy link
Contributor Author

xedin commented May 15, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4813a90d776ae580a9df8924f78fbdd12a54154e

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4813a90d776ae580a9df8924f78fbdd12a54154e

@xedin
Copy link
Contributor Author

xedin commented May 15, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4813a90d776ae580a9df8924f78fbdd12a54154e

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4813a90d776ae580a9df8924f78fbdd12a54154e

@xedin xedin force-pushed the rdar-63230293-5.3 branch from 4813a90 to e3767d4 Compare May 15, 2020 17:45
@xedin
Copy link
Contributor Author

xedin commented May 15, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4813a90d776ae580a9df8924f78fbdd12a54154e

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4813a90d776ae580a9df8924f78fbdd12a54154e

…sure parameter(s)

Detect situation when it's impossible to determine types for
closure parameters used in the body from the context. E.g.
when a call closure is associated with refers to a missing
member.

```swift
struct S {
}

S.foo { a, b in } // `S` doesn't have static member `foo`

let _ = { v in } // not enough context to infer type of `v`

_ = .foo { v in } // base type for `.foo` couldn't be determined
```

Resolves: [SR-12815](https://bugs.swift.org/browse/SR-12815)
Resolves: rdar://problem/63230293
@xedin xedin force-pushed the rdar-63230293-5.3 branch from e3767d4 to 810069e Compare May 15, 2020 17:56
@xedin
Copy link
Contributor Author

xedin commented May 15, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e3767d4c404a6bfdde0e35ba956263ecc8f7d46d

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e3767d4c404a6bfdde0e35ba956263ecc8f7d46d

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.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants