629e087b1354b14d05388e179f3e1013e2c35537 — Martin Angers 8 months ago c459dde
similar for error unwrap, any optional really
1 files changed, 1 insertions(+), 0 deletions(-)

M codegen/optional.ssa
M codegen/optional.ssa => codegen/optional.ssa +1 -0
@@ 33,6 33,7 @@ export function w $main() {
 function $printOptional(:optional %p) {
 @start
   # unwrap (e.g. if optional { /* access unwrapped value */ } else { /* none */ }
+  # unwrapping an error (e.g. let res = may_crash(); res!.value) is the same
   %tag =w loadub %p
   jnz %tag, @some, @none