[SR-1814] Crash on assignment of class array to protocol array #44423
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
crash
Bug: A crash, i.e., an abnormal termination of software
run-time crash
Bug → crash: Swift code crashed during execution
runtime
The Swift Runtime
Environment
Xcode Version 7.3.1 (7D1014)
Additional Detail from JIRA
md5: 52e26ca1ca9ed52842e02ada95731ce5
relates to:
Issue Description:
Run this code in a new command line app:
import Foundation
print("Hello, World!")
protocol P1 {}
protocol P2 {}
protocol P3: P1, P2 {}
class C4: P3 {}
var p1: [P1] = [C4()]
var p2: [P2] = [C4()]
var c4 = [C4()]
p1 = c4
Backtrace:
Hello, World!
fatal error: array cannot be bridged from Objective-C
(lldb) bt
thread Redundant Load Elimination Patches #1: tid = 0x1bd422, 0x00000001001a2f58 TestProject`function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> () + 40, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
frame #0: 0x00000001001a2f58 TestProject`function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> () + 40
frame Redundant Load Elimination Patches #1: 0x00000001000355df TestProject`Swift._arrayForceCast <A, B> (Swift.Array<A>) -> Swift.Array<B> + 831
frame Remove unnecessary
unsafeUnwrap
calls. #2: 0x000000010026d737 TestProject`main + 519 at main.swift:22frame Initial implementation of a @_cdecl attribute to export top-level functions to C #3: 0x00007fff9aaca5ad libdyld.dylib`start + 1
(lldb)
The text was updated successfully, but these errors were encountered: