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-2105] Bogus "will never be executed" error in init?(exactly:) #44713

Closed
jckarter opened this issue Jul 18, 2016 · 4 comments
Closed

[SR-2105] Bogus "will never be executed" error in init?(exactly:) #44713

jckarter opened this issue Jul 18, 2016 · 4 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

Comments

@jckarter
Copy link
Member

Previous ID SR-2105
Radar None
Original Reporter @jckarter
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, DiagnosticsQoI
Assignee None
Priority Medium

md5: 46d3fdc2f8f664d5e16cba6d96828f7c

relates to:

  • SR-2729 Function incorrectly claims to be never executed

Issue Description:

While building the standard library:

/Users/jgroff/src/s/swift/stdlib/public/core/Integers.swift.gyb:230:10: warning: will never be executed
  public init?<T : FloatingPoint>(exactly source: T) {
         ^
/Users/jgroff/src/s/swift/stdlib/public/core/Integers.swift.gyb:232:5: note: a call to a noreturn function
    fatalError()
    ^
@swift-ci
Copy link
Collaborator

Comment by Klaas Mer (JIRA)

I've got a similar warning in a very simple code snippet:

http://stackoverflow.com/questions/39621792/swift-method-that-returns-never-how-to-mute-warning

@jckarter
Copy link
Member Author

klaas (JIRA User) Do you know if you get that warning only in playgrounds, or does it show up in non-playground Swift projects too? It may be a problem with the playground logger.

@swift-ci
Copy link
Collaborator

Comment by Klaas Mer (JIRA)

Yes, it applies to a regular project as well. I just created a new Cocoa App in Xcode 8 (8A218a) and pasted the snippet into AppDelegate.swift

I get the same error in my real project, that is still on Xcode 7.3 (using Swift 2.2 and the "@NoReturn" annotation).

@slavapestov
Copy link
Member

#8951

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

No branches or pull requests

3 participants