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

[SR-5429] first(where:) on AnySequence no longer compiles #48003

Closed
CharlesJS opened this issue Jul 11, 2017 · 3 comments
Closed

[SR-5429] first(where:) on AnySequence no longer compiles #48003

CharlesJS opened this issue Jul 11, 2017 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 4.0 type checker Area → compiler: Semantic analysis

Comments

@CharlesJS
Copy link

Previous ID SR-5429
Radar None
Original Reporter @CharlesJS
Type Bug
Status Closed
Resolution Duplicate
Environment

Xcode 9 beta 3
(current trunk is currently not compiling)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.0Regression, TypeChecker
Assignee None
Priority Medium

md5: 6ec68462e50529dcc894c2159e855ad6

blocks:

  • SR-5387 AnySequence.flatMap does not compile in Swift 4.0

Issue Description:

If AnySequence has a generic parameter to a function as its element type, trying to use .first(where:) on that sequence will fail to compile:

func foo<T>(t: T) {
    _ = AnySequence([t]).first(where: { (t: T) in true }) // error: cannot convert value of type '(T) -> Bool' to expected argument type '((_)) -> Bool'
}

I believe that this worked in Xcode 9 beta 2, making this a regression.

@belkadan
Copy link
Contributor

@rudkx, look familiar?

@rudkx
Copy link
Member

rudkx commented Jul 11, 2017

Looks like the same issue as SR-5387.

@rudkx
Copy link
Member

rudkx commented Jul 11, 2017

Same underlying issue as SR-5387. I've got a PRs up for master and swift-4.0-branch:

master: #10847
swift-4.0-branch: #10848

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 4.0 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants