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-8435] Warn if there's code in a function that takes an uninhabited type #50958

Closed
mdiep opened this issue Aug 1, 2018 · 1 comment
Closed
Assignees
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 good first issue Good for newcomers

Comments

@mdiep
Copy link
Contributor

mdiep commented Aug 1, 2018

Previous ID SR-8435
Radar None
Original Reporter @mdiep
Type Bug
Status Resolved
Resolution Done
Environment

Swift 4.2

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee @theblixguy
Priority Medium

md5: 9f25bac15088b532d542ce898612f411

Issue Description:

func f(_: Never) -> Int {
    print("foo")
    return 5
}

`f` cannot be called since `Never` is uninhabited. Swift should warn that the code there will never be executed.

@theblixguy
Copy link
Collaborator

@belkadan: PR - #20528

@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 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants