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

LLDB gets Swift Foundation overlay optionals wrong

    XMLWordPrintable

    Details

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

      Xcode Version 11.1 (11A1027)

      Description

      Run this code in a real iOS app with a breakpoint at the last line:

              struct Booking {
                  var start_time: Date?
              }
              let booking : Booking? = Booking()
              
              let urlAsString = "http://www.google.de/"
              let url = URL(string: urlAsString)
              
              print(booking, url) // breakpoint here
      

      Look in the variables list in the debugger. Both `booking` and `url` are shown as `nil`. But in fact they are not `nil`, as the console will prove (see screen shot).

      If you change Date and URL to NSDate and NSURL the problem goes away. So it is confined to Swift overlay types.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              davide Davide C. C. Italiano
              Reporter:
              mattneub Matt Neuburg
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: