Crash adding a class type to a dictionary

Originator:ktam64
Number:rdar://18503353 Date Originated:09/30/2014
Status:Open Resolved:
Product:Xcode Product Version:6.1
Classification:Crash Reproducible:Yes
 
Summary:
When running the following code in a Xcode 6.1 GM seed and 6.1 b2 swift playground for OS X there is a crash.

====
import Cocoa

class BaseClass {
    let classDescription: String
    init(description: String) {
        self.classDescription = description
    }
    func description() -> String { return self.classDescription }
}

class SubClass1 : BaseClass {
    init() {
        super.init(description: "subclass1")
    }
}

class SubClass2 : BaseClass {
    init() {
        super.init(description: "subclass2")
    }
}

let classMapping = ["subclass1": SubClass1.self, "subclass2": SubClass2.self]
let myClass = classMapping["subclass1"]
====

Steps to Reproduce:
Create an OS X swift playground paste in the code in the description section between the ==== and then see the crash on the line creating the dictionary.

Expected Results:
That it doesn't crash. That the classMapping const is of type [String:BaseClass.Type].

Actual Results:
I get a crash with the following output:
* thread #1: tid = 0x366b, 0x00000001024b4a65 libswiftCore.dylib`swift_getSummary + 37, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x68)
  * frame #0: 0x00000001024b4a65 libswiftCore.dylib`swift_getSummary + 37
    frame #1: 0x0000000102590b8c libswiftCore.dylib`-[SwiftObject debugDescription] + 92
    frame #2: 0x000000010275bb40 libswiftFoundation.dylib`protocol witness for Swift.MirrorType.summary.getter : Swift.String in conformance Foundation._ObjCMirror : Swift.MirrorType + 64
    frame #3: 0x0000000102327f3b PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.getSummaries (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.Bool) -> (brief : Swift.String, long : Swift.String) + 171
    frame #4: 0x000000010232a963 PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encodeStructuredImpl (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, Swift.Array<Swift.Range<Swift.UInt64>>...) -> () + 867
    frame #5: 0x0000000102326c4a PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encodeStructured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, PlaygroundLogger.LoggerCappingPolicy) -> () + 1562
    frame #6: 0x0000000102327263 PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encodeStructured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64) -> () + 323
    frame #7: 0x000000010232d5c0 PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encode (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64) -> () + 7776
    frame #8: 0x0000000102327deb PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encodeChildren (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, Swift.Range<Swift.UInt64>) -> () + 2203
    frame #9: 0x000000010232b301 PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encodeStructuredImpl (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, Swift.Array<Swift.Range<Swift.UInt64>>...) -> () + 3329
    frame #10: 0x0000000102326a68 PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encodeStructured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, PlaygroundLogger.LoggerCappingPolicy) -> () + 1080
    frame #11: 0x00000001023273bf PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encodeStructured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64) -> () + 671
    frame #12: 0x000000010232d5c0 PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encode (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64) -> () + 7776
    frame #13: 0x0000000102327deb PlaygroundLogger`PlaygroundLogger.PlaygroundObjectWriter.encodeChildren (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, Swift.Range<Swift.UInt64>) -> () + 2203
    frame #14: 0x000000010232b301 PlaygroundLogger`PlaygroundLogg

Version:
Xcode 6.1 beta 2, and Xcode 6.1 beta 3. Swift playground for OSX.

Notes:


Configuration:
15" MBP non Retina. 16GByte Ram. 500GByte SSD drive.

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!