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-12955] Redundant error when using @convention(c) on an error type #55401

Closed
mikeash opened this issue Jun 8, 2020 · 2 comments
Closed

[SR-12955] Redundant error when using @convention(c) on an error type #55401

mikeash opened this issue Jun 8, 2020 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis

Comments

@mikeash
Copy link
Contributor

mikeash commented Jun 8, 2020

Previous ID SR-12955
Radar None
Original Reporter @mikeash
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee None
Priority Medium

md5: c09bd1be328b6db3981346e9991bf36c

Issue Description:

Compiling this line:

let f: @convention(c) (T) -> Void

Produces these errors:

test2.swift:1:24: error: cannot find type 'T' in scope
let f: @convention(c) (T) -> Void
                       ^
test2.swift:1:23: error: '(<<error type>>) -> Void' is not representable in Objective-C, so it cannot be used with '@convention(c)'
let f: @convention(c) (T) -> Void
                      ^

The second error is redundant and potentially misleading. When the trigger is an error type, it should probably be omitted, and allow the actual type error to convey the problem on its own.

@LucianoPAlmeida
Copy link
Collaborator

Resolved in #32337

@mikeash can you verify on the next snapshot and close? 🙂

@mikeash
Copy link
Contributor Author

mikeash commented Jun 15, 2020

Verified against master. Thanks for the quick fix! 5/7 service would bug again.

@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 diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants