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-7275] [4.1 regression] Regression in Sequence with Generic where clause #49823

Closed
swift-ci opened this issue Mar 25, 2018 · 4 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 4.1 type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-7275
Radar rdar://problem/38868122
Original Reporter lucatorella (JIRA User)
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.1Regression, TypeChecker
Assignee None
Priority Medium

md5: e0f96d76a0b78040233bc5c88b3700f3

Issue Description:

The following code compiles with Swift 4.0, but not with Swift 4.1 beta (Xcode 9.3 beta 4)

extension Sequence where Iterator.Element: AnyObject { 
    public func containsObjectIdentical(to object: AnyObject) -> Bool { 
        return contains { $0 === object } 
    } 
}

The following change mitigates the issue and compiles both in Swift 4.0 and Swift 4.1

extension Sequence where Element: AnyObject {
    public func containsObjectIdentical(to object: AnyObject) -> Bool {
        return contains { $0 === object }
    }
}
@belkadan
Copy link
Contributor

Can't see any reason why the original shouldn't work. Thanks, Luca!

@swift-ci create

@slavapestov
Copy link
Member

This seems to have been fixed on master, so I added a regression test: #15786

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jul 26, 2018

lucatorella (JIRA User), Could you verify if the problem is fixed and if so move the JIRA to "Closed"?
Thanks!
Anna

@swift-ci
Copy link
Collaborator Author

Comment by Luca Torella (JIRA)

I confirm it’s fixed. Both version work in 4.1.2 and 4.2. Closing now. Thanks!

@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.1 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants