Swift: Broken codegen in nonrecursive enum initializer
| Originator: | rix.rob | ||
| Number: | rdar://18592791 | Date Originated: | 09-Oct-2014 00:20 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6.1 GM seed 2 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: I’m writing an initializer for an enum which uses a couple of nonrecursive functions internal to it, and which the compiler apparently does broken codegen for, resulting in a failed compile. Steps to Reproduce: 1. Check out this branch (also attached): https://github.com/robrix/Traversal/pull/5 2. Build it. Expected Results: I expected it to build, or if my code is broken to tell me that. Actual Results: It does not build, apparently due to broken codegen: Stored value type does not match pointer operand type! store %SQ.17* %5, %SQ** %45, align 8, !dbg !422 %SQ*LLVM ERROR: Broken function found, compilation aborted! Version: Xcode 6.1 GM seed 2 on Yosemite 14A379a Notes: The error isn’t shown in Xcode at all, even if I copy the entire transcript using the contextual menu item. xcodebuild logged it tho. Wrapping the reduction in a closure and calling that in the second parameter of the Cons also fails: https://github.com/robrix/Traversal/commit/a7a5539c902a1d01c630799f83fdaa4abe70f1c9 Performing the reduction eagerly and passing that in as the second parameter of the Cons succeeds: https://github.com/robrix/Traversal/commit/51fbec9e4f4a4bfdf8d83dcb19c1f739f8822643 (Note however that this form is incorrect; I’m using Stream because I need evaluation to be lazy.)
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!