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-1196] When a closure is inferred to throw, show where (if it's a problem) #43804

Open
belkadan opened this issue Apr 9, 2016 · 2 comments
Assignees
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation improvement

Comments

@belkadan
Copy link
Contributor

belkadan commented Apr 9, 2016

Previous ID SR-1196
Radar rdar://problem/43764378
Original Reporter @belkadan
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI
Assignee @xedin
Priority Medium

md5: 7b55fdf5e52daeeea9c94f66f3ad8ac5

Issue Description:

func process(line: UInt = #line, fn: () -> Void) {}
func process(line: UInt = #line) -> Int { return 0 }
func dangerous() throws {}

func test() {
  process {
    try dangerous()
    test()
  }
}
<stdin>:6:11: error: invalid conversion from throwing function of type '() throws -> ()' to non-throwing function type '() -> Void'
  process {
          ^

It Would Be Nice™ if we also pointed to the try (or throw) in the closure that caused it to be inferred as throwing.

@belkadan
Copy link
Contributor Author

@xedin
Copy link
Member

xedin commented Aug 27, 2018

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation improvement
Projects
None yet
Development

No branches or pull requests

2 participants