Unable to print anonymous variable within closure in lldb with Swift 3 on Xcode 8.1 Beta 2 project without Carthage
| Originator: | javier.api | ||
| Number: | rdar://28612071 | Date Originated: | 10/4/2016 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 8.1 Beta 2 |
| Classification: | Reproducible: | Always |
Summary: I haven't been able to use lldb with Swift in Xcode since Swift first came out. In the most recent months, I was under the impression that this was because I was using Carthage, which according to Apple is not supported due to the use of precompiled Swift binaries. However, I recently started playing with a side project without the use of Carthage, and after writing just a couple hundred lines of Swift on a brand new Xcode 8 GM project, as soon as I tried to set a breakpoint and `po` anything, I only got lldb errors everywhere. I originally filed rdar://28477944, but I still reproduce these in Xcode 8.1 Beta 2. See open source Github project that I used to reproduce this: https://github.com/JaviSoto/SwiftPoker. In case I push more commits, try commit hash `28c3b4acfe4c1bfa80a99f4071f75b00c99762b4` where I definitely reproduced these errors. See attached screenshots for examples of the portions of code where I set the breakpoints and the errors I got. Steps to Reproduce: 1. Open project from https://github.com/JaviSoto/SwiftPoker commit hash 28c3b4acfe4c1bfa80a99f4071f75b00c99762b4 2. Set breakpoint on Hand.swift:208 3. Run tests on SwiftPoker target 4. Wait for breakpoint to be hit 4. Type `po $0` in lldb Expected Results: The contents of the anonymous variable `$0` are printed. Actual Results: It doesn't work, and error is printed: error: <EXPR>:3:1: error: anonymous closure argument not contained in a closure $0 ^ Version: Xcode 8.1 Beta 2, Swift 3, macOS Sierra GM
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!