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-580] False negative in "variable was never mutated" #43197

Open
gribozavr opened this issue Jan 19, 2016 · 1 comment
Open

[SR-580] False negative in "variable was never mutated" #43197

gribozavr opened this issue Jan 19, 2016 · 1 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

Comments

@gribozavr
Copy link
Collaborator

Previous ID SR-580
Radar None
Original Reporter @gribozavr
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee None
Priority Medium

md5: 49666d7f896eca11031f8c6971fb6cb6

Issue Description:

This code should produce a warning "variable 'result' was never mutated".

func foo(x: Int) -> Int {
  var result = x + 1
#if NOT_ENABLED
  _ = result
#endif
  return result
}
@tjw
Copy link
Contributor

tjw commented Apr 15, 2016

See conversation on swift-dev about this not being a StarterBug <http://thread.gmane.org/gmane.comp.lang.swift.devel/1455\>. There was also a bit of conversation off-list that perhaps the current behavior is actually what we want <https://twitter.com/jckarter/status/710955983690797056\>

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis removed the good first issue Good for newcomers label Jun 24, 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 diagnostics QoI Bug: Diagnostics Quality of Implementation
Projects
None yet
Development

No branches or pull requests

3 participants