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-892] Closure type inference does not work with inout arguments #43504

Closed
gribozavr opened this issue Mar 7, 2016 · 1 comment
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@gribozavr
Copy link
Collaborator

Previous ID SR-892
Radar rdar://problem/25004356
Original Reporter @gribozavr
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: 806344e909b6fa51eb4eea37b139f607

duplicates:

  • SR-3479 Segmentation fault and other error for closure with inout parameter

Issue Description:

I think this code should compile:

protocol MyMC {
  associatedtype Element
}

extension MyMC {
  mutating func test(f: (inout Element) -> Void) {}
}

struct MyA : MyMC {
  typealias Element = Int32
}

var a = MyA()
a.test { (x: inout Int32) -> Void in x += 1 }
a.test { $0 += 0 } // does not work
@slavapestov
Copy link
Member

This works in 3.1.

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

No branches or pull requests

2 participants