Swift compiler bug when calling a function with default parameter values via a constant/variable reference
| Originator: | ullrich.schaefer | ||
| Number: | rdar://18041799 | Date Originated: | 16-Aug-2014 11:24 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 6.0 (6A279r) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: Having a const (`let`) point to a function and calling that function should work. It doesn't work though when said function has a default value for one of its parameters. Same situation with normal functions and class methods Example: https://gist.github.com/stigi/336a9851cd80fdef22ed Steps to Reproduce: 1. Create a function `foo` with a parameter and supply a default value for that parameter 2. Create a constant pointing to that function like so `let bar = foo` 3. Add a call to `foo` 4. Build and run 5. Add a call to `bar` (6. Build and run) Expected Results: Calling `bar` has the same effect as calling `foo`. Actual Results: Adding the call to `bar` crashes SourceKitService and prevents the project from building. Version: Xcode Version 6.0 (6A279r) Notes: Happens for normal functions, class functions. Also happens when not using a constant to point to `foo`, but a variable. Configuration: Attachments:
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!