Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-11546] LLDB gets Swift Foundation overlay optionals wrong #4479

Closed
mattneub opened this issue Sep 29, 2019 · 3 comments
Closed

[SR-11546] LLDB gets Swift Foundation overlay optionals wrong #4479

mattneub opened this issue Sep 29, 2019 · 3 comments
Assignees
Labels
bug Something isn't working LLDB for Swift

Comments

@mattneub
Copy link

Previous ID SR-11546
Radar None
Original Reporter @mattneub
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

Xcode Version 11.1 (11A1027)

Additional Detail from JIRA
Votes 1
Component/s LLDB for Swift
Labels Bug
Assignee @dcci
Priority Medium

md5: a862911179814104bbf69ddcd81faac5

blocks:

  • SR-11593 REPL incorrectly reports URL as nil

relates to:

  • SR-11593 REPL incorrectly reports URL as nil

Issue 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.

@swift-ci
Copy link

Comment by Dylan Kohler (JIRA)

Also reported here: https://stackoverflow.com/questions/58108824/instantiated-optional-variable-shows-as-nil-in-xcode-debugger/58156592

It appears the types need not be optional, just overlays. Either Date? or Date variables within the struct can cause the issue.

@dcci
Copy link
Mannequin

dcci mannequin commented Oct 10, 2019

Dupe of SR-11593

@swift-ci
Copy link

Comment by Dave (JIRA)

@dcci - maybe, but this is the more general case so the duplicate flagging should be the other way around lest the generality of this issue be missed.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLDB for Swift
Projects
None yet
Development

No branches or pull requests

2 participants