Search code examples
swiftdatellvmlldb

lldb optional Date it's never nil


Can someone explain me why the lldb when printing a Date optional passed as nil doesn't print nil.

I declared a function which receives optional Date:

override func setup() {
    super.setup()

    optionalFooTest(startDate: nil, endDate: nil)
}

func optionalFooTest(startDate: Date?, endDate: Date?) {

    if startDate == nil {

        let foo = "foo"
    }
}

The behaviour is it will enter in the if but the lldb when I print the startDate it gives me a value or when i test if it's nil.

screenshot


Solution

  • As @Joakim Danielson mentioned in comments this is the bug in lldb mentioned here: i was thinking the problem was the struct Date but it's not, it's the lldb itself.