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

After change in lldb, false still evaluates to true in if statement

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: LLDB for Swift
    • Labels:
      None
    • Environment:

      Xcode 10.2

      macOS Mojave 10.14.4

      Description

      After changing a boolean to false in lldb, it's still evaluating to true. Here's a simplified version.

      => is a breakpoint

      ```
       func getCount(actionWasSuccessful successful: Bool) -> Int {
      => var count = 0

      // (lldb) po successful (returns true)
      // (lldb) exp successful = false
      // (lldb) po successful (returns false)

      if successful

      { => count += 1 // breakpoint stops here }

      else {
      => count = 0 // breakpoint should stop here
      }
      return count
      }

      let count = getCount(successful: true)
      print(count) // returns 1
      ```

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ripbenfranklin Drew Sullivan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: