Uploaded image for project: 'Swift'
  1. Swift
  2. SR-580

False negative in "variable was never mutated"

    XMLWordPrintable

    Details

      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
      }
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            gribozavr Dmitri Gribenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: