这个可能很容易.我们知道操作符&对整数进行模运算(环绕),而运算符会导致错误.
@H_403_1@$swift
1> var x: Int8 = 100
x: Int8 = 100
2> x &+ x
$R0: Int8 = -56
3> x + x
Execution interrupted. Enter Swift code to recover and continue.
这有什么错误?我无法抓住它,我无法将其转为可选:
@H_403_1@4> do {try x + x} catch {print("got it")} Execution interrupted. Enter Swift code to recover and continue. 5> try? x + x Execution interrupted. Enter Swift code to recover and continue.我很确定这种错误是从this StackOverflow question(除零)的同一种错误,但我不知道是否可以捕获这种错误.我错过了什么简单的事情?可以被困吗?如果是这样,怎么样?