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-11279] -profile-generate flag generates incorrect "Will never be executed" warning when there is No statement to execute #53680

Open
swift-ci opened this issue Aug 9, 2019 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Aug 9, 2019

Previous ID SR-11279
Radar None
Original Reporter eliottparis (JIRA User)
Type Bug
Environment
  • macOS 10.14.5 (18F203)

  • Xcode 10.2.1 (10E1001)

  • Swift 5.0

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 840a10e1487f521ee390d4d5cbb2e4dc

Issue Description:

Compiling a block of code that does not contain any statement in it generates an incorrect "Will never be executed" warning when the "-profile-generate" flag is set.

Example:

if false {}   // warning: Will never be executed           
else {
  return true
}

(Above example does compile without warning if the "-profile-generate" flag is not set)

@belkadan
Copy link
Contributor

I'd argue it should always emit the warning, but it should definitely be consistent! cc ravikandhadai (JIRA User)

@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants