I've typed a very simple error into an Xcode playground:
import UIKit
var greeting = "Hello, playground"
["foo", "bar"][2] // error
The console correctly prints the error:
Swift/ContiguousArrayBuffer.swift:580: Fatal error: Index out of range
However the Xcode Playground error pop-up instead says:
error: Execution was interrupted, reason: EXC_BREAKPOINT (code=1, subcode=0x18f2ea5d8).
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
How do I "use thread return -x
" in the Xcode playground, as directed? Where can I type this and what does the command do?
Is some kind of setting, such as Xcode exception breakpoints, mistakenly enabled in this Playground? Why is this error being displayed instead of the actual Fatal error: Index out of range
underlying error?
NOTE: I know what the simple code issue is and can easily fix it. This question is about why that error message is being displayed, and how/if I can use thread return -x
in the Playground.