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

REPL doesn't correctly handle guard variable shadowing

    XMLWordPrintable

    Details

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

      Description

      let hex = "DEADBEEF"
      let num = Int(hex, radix: 16)
      guard let num = num else {
          fatalError("Couldn't parse \(hex) as an integer")
      }
      

      pasting the above program into the REPL, then adding print(num) prints Optional(3735928559). When I compile and run it, I get 3735928559.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jaybuff Jay Buffington
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: