Skip to content

[SR-7808] LLDB can't find identifiers from breakpoints within closures that were passed into an enclosing function #4496

Open
@swift-ci

Description

@swift-ci
Previous ID SR-7808
Radar rdar://problem/30948792
Original Reporter twof (JIRA User)
Type Bug
Environment

Xcode 9.4. Also observed in Xcode 9.3 and earlier

Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug, DebugInfo
Assignee None
Priority Medium

md5: fe2513eff690d40288f61c4f3ae2ea0d

Issue Description:

Repro code:

func foo(source: String, callback: (String) -> ()) {
    callback("hello")
}

func bar(source: String) {
    foo(source: source) { (anything) in
        print(anything) // (lldb) po source
                        // error: <EXPR>:3:1: error: use of unresolved identifier 'source'
                        // source
                        // ^~~~~~
    }
}

bar(source: "anything")


let source = "anything"
foo(source: source) { param in
    print(param) // (lldb) po source
                 // "anything"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions