Swift: Segmentation fault when specifiying property type with a default value

Originator:amber
Number:rdar://20674653 Date Originated:April 23, 2015
Status:Open Resolved:false
Product:Developer Tools Product Version:Swift 1.2
Classification:Bug Reproducible:Always
 
Summary:
A struct with a property that has a default value specified, and also has a type specifier will cause a segmentation fault:11 if you create an extension to that struct in a separate file, and implement an initializer. Note, if you remove the type specifier it will build successfully. 

Steps to Reproduce:
1. Create a new file in a project and declare a new struct. ( struct myStruct { } )
2. Give the struct a string property with a type specifier and a default value. (var myString: String = “myString”)
3. Add a new file to the project and add an extension to the struct declared in step 1. ( extension myStruct { }
4. Add a blank initializer to the extension. ( init() { } )
5. Try to build the target

Expected Results:
Expect the target to build successfully 

Actual Results:
segmentation fault: 11

Regression:
If you remove the type specifier from the property ( var myString = “myString” ) it will build successfully.

Notes:
As far as I can tell this problem will occur with any type of property, and any initializer signature in the extension. See example project attached.

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!