3 ms·
yes, it is a runtime error. given the code let foo = bar! If bar is nil, you'll get a runtime error "unexpectedly found nil when unwrapping bar" in my opinio
by rockshassa 11y ago
yes, it is a runtime error. given the code
let foo = bar!
If bar is nil, you'll get a runtime error "unexpectedly found nil when unwrapping bar"
in my opinion, the benefit of optionals in general is that it allows you to guarantee at compile time that certain variables (non optionals) will _never_ be nil, which enables all kinds of compiler optimizations.