[SR-6645] EXC_BAD_ACCESS in code using protocol extension for defining default implementation #49194
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
run-time crash
Bug → crash: Swift code crashed during execution
Environment
XCode 9.2 (9C40b), Swift 4, MacOS Sierra 10.12.6
Additional Detail from JIRA
md5: f7d4aff017dfdc868f6ea443891309f9
duplicates:
Issue Description:
The following playground sample results in a crash (EXC_BAD_ACCESS) while it should work perfectly fine as far as I can tell:
It crashes on line marked with 2, when called from 1.
It seems to occur because a protocol extension is defined with a default implementation for the addObserver method.
The full crash:
error: Playground execution aborted: error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0xffff9f7ffffa0440).
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
See also: https://stackoverflow.com/questions/47901032/swift-exc-bad-access-with-default-implementation-defined-in-protocol-extension
The text was updated successfully, but these errors were encountered: