Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

18503353: Crash adding a class type to a dictionary #3035

Open
openradar-mirror opened this issue Aug 11, 2015 · 0 comments
Open

18503353: Crash adding a class type to a dictionary #3035

openradar-mirror opened this issue Aug 11, 2015 · 0 comments

Comments

@openradar-mirror
Copy link

Description

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 22108400: Swift 2.0b4: Allow if let and guard let to assign to self in failable value type initializers #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.dylibswift_getSummary + 37 frame #1: 0x0000000102590b8c libswiftCore.dylib-[SwiftObject debugDescription] + 92
      frame 22108390: Swift 2.0b4: Allow assignment of nil to self in failable initializers to indicate failure #2: 0x000000010275bb40 libswiftFoundation.dylibprotocol witness for Swift.MirrorType.summary.getter : Swift.String in conformance Foundation._ObjCMirror : Swift.MirrorType + 64 frame #3: 0x0000000102327f3b PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.getSummaries (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.Bool) -> (brief : Swift.String, long : Swift.String) + 171
      frame 22108127: Apple Music: CarPlay does not show the For You Playlists #4: 0x000000010232a963 PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encodeStructuredImpl (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, Swift.Array<Swift.Range<Swift.UInt64>>...) -> () + 867 frame #5: 0x0000000102326c4a PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encodeStructured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, PlaygroundLogger.LoggerCappingPolicy) -> () + 1562
      frame 22108095: Changing account in Music app requires force-quit #6: 0x0000000102327263 PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encodeStructured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64) -> () + 323 frame #7: 0x000000010232d5c0 PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encode (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64) -> () + 7776
      frame 22107434: Providing Generic Generator for protocol intermittently crashes compiler #8: 0x0000000102327deb PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encodeChildren (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, Swift.Range<Swift.UInt64>) -> () + 2203 frame #9: 0x000000010232b301 PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encodeStructuredImpl (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, Swift.Array<Swift.Range<Swift.UInt64>>...) -> () + 3329
      frame 22107245: Xcode 7 beta 4 (7A165t) Interface Builder ignores background color set on UITableView #10: 0x0000000102326a68 PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encodeStructured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, PlaygroundLogger.LoggerCappingPolicy) -> () + 1080 frame #11: 0x00000001023273bf PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encodeStructured (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64) -> () + 671
      frame 22106516: watchOS 2 Beta 4: Can’t Import CoreText #12: 0x000000010232d5c0 PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encode (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64) -> () + 7776 frame #13: 0x0000000102327deb PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encodeChildren (PlaygroundLogger.PlaygroundObjectWriter)(Swift.MirrorType, Swift.UInt64, Swift.Range<Swift.UInt64>) -> () + 2203
      frame 22105625: Mac OS X 10.11: Battery status alwasy shows "20:00 Remaining" #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.

Product Version: 6.1
Created: 2014-09-30T18:28:27.413564
Originated: 2014-09-30T00:00:00
Open Radar Link: http://www.openradar.me/18503353

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant