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-10837] init partial application regression #53227

Closed
Agarunov opened this issue Jun 5, 2019 · 6 comments
Closed

[SR-10837] init partial application regression #53227

Agarunov opened this issue Jun 5, 2019 · 6 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 5.1

Comments

@Agarunov
Copy link

Agarunov commented Jun 5, 2019

Previous ID SR-10837
Radar rdar://problem/51442825
Original Reporter @Agarunov
Type Bug
Status Closed
Resolution Done
Environment

Swift 5.1, Xcode 11.0 beta (11M336w)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 5.1Regression
Assignee @Agarunov
Priority Medium

md5: 3e2187813cb24218d3d1d7b9f8fd97a3

Issue Description:

This code doesn't compile in Swift 5.1:

struct Some {
    let value: Int
    
    static func make1(from value: Any) -> Some? {
        return (value as? Int).flatMap(self.init(value:)) // error: Partial application of 'mutating' method is not allowed
    }
    
    static func make2(from value: Any) -> Some? {
        return (value as? Int).flatMap {
            self.init(value: $0) // no error
        }
    }
}
@belkadan
Copy link
Contributor

belkadan commented Jun 5, 2019

@xedin, looks like you missed a special case for initializers? (They're not instance members, but they're not "static" either.)

@xedin
Copy link
Member

xedin commented Jun 5, 2019

Yeah, looks that way, I'll get this sorted out right away!

@xedin
Copy link
Member

xedin commented Jun 5, 2019

Opened PR #25265 to fix this and added some more tests to make sure that we didn't break other cases.

@xedin
Copy link
Member

xedin commented Jun 6, 2019

Fixed by #25265 Please verify against next available master snapshot, menwhile I'll get it cherry-picked to 5.1 branch.

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Aug 9, 2019

@Agarunov, Could you verify if the problem is fixed and if so move the JIRA to "Closed"?

Thanks!
Anna

@Agarunov
Copy link
Author

Agarunov commented Aug 9, 2019

The problem is fixed.

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

No branches or pull requests

4 participants