These type of statements used to only work for ?!T types:
without x =? y, error:
# do something with error
Now they also work for any Result[T, E] types, with the caveat that the error is converted to a ref CatchableError.
Conversion is necessary, because we need a type for the error variable that works for any type of result, in case that we have multiple =? bindings in the without expression, e.g.:
var a: ?!int
var b: Result[int, string]
without x =? a and y =? b, error:
# without conversion error types would clash
These type of statements used to only work for
?!T
types:Now they also work for any
Result[T, E]
types, with the caveat that the error is converted to a ref CatchableError. Conversion is necessary, because we need a type for the error variable that works for any type of result, in case that we have multiple=?
bindings in thewithout
expression, e.g.: