Script crashes playgrounds

Originator:andrew
Number:rdar://19478900 Date Originated:15-Jan-2015
Status:Open Resolved:
Product:Xcode Product Version:
Classification: Reproducible:
 
The attached script will cause Playgrounds to crash, and not work again until Xcode is reloaded

Steps to Reproduce:
1. Install Xcode 
2. Open a new playground
3. Copy and paste the following script:

struct A
{
    init()
    {
    }
}

struct B
{
    var a : [A]
    init()
    {
        a = []
    }
}

var b = [B](count: 4, repeatedValue: B())
var c = A()

b[0].a.append(c)


Expected Results:
No popup windows, no crashes.

The value of b might be shown as:
[{A}, {0 elements}, {0 elements}, {0 elements}]


Actual Results:
A pop-up window appears:

Communication with the playground service was interrupted unexpectedly.
The playground service "com.apple.dt.Xcode.Playground" may have generated a crash log.


Further typing causes another popup window:

Error running playground.
An error occurred while trying to communicate with a helper application. You may need to restart Xcode before playgrounds will run again.

Version:
Xcode Version 6.1.1 (6A2008a)
OS X Version 10.10.2 (14C94b)

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!