Lazy optional types always nil
| Originator: | brian.nickel | ||
| Number: | rdar://17192398 | Date Originated: | 05-Jun-2014 09:55 PM |
| Status: | Resolved | Resolved: | 18-Jul-2014 04:31 PM |
| Product: | Developer Tools | Product Version: | Version 6.0 (6A215l) |
| Classification: | Reproducible: |
I reported in rdar://17183713 that non-optional lazy methods produce a compiler error in the ObjC header so I've switched to optional lazy's. Unfortunately, lazy optionals are always nil and never execute the RHS. I assume there's some initialization pass where Swift assigns initial values to things and is assigning an initial nil value to these lazy properties canceling the laziness.
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!