Swift-related crash

Originator:garth
Number:rdar://19659797 Date Originated:29-Jan-2015 10:46 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.2b4 6C107a
Classification:Serious Bug Reproducible:Always
 
This code in a playground == not happy:

import Foundation

protocol Test {
    func getAValue() -> Int
}

@objc class SuperClass {}

class TestClass: SuperClass {
    func getAnotherValue() -> Int {
        return requiresTest(self)
    }
}

let foo = TestClass() // Error: EXC_BAD_INSTRUCTION

foo.getAnotherValue()

func requiresTest(x: Test) -> Int {
    return x.getAValue()
}

extension TestClass: Test {
    func getAValue() -> Int {
        return 42
    }
}

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!