diff --git a/results.nim b/results.nim index 57911df..22c35d6 100644 --- a/results.nim +++ b/results.nim @@ -357,7 +357,7 @@ func raiseResultError[T, E](self: Result[T, E]) {.noreturn, noinline.} = when E is ref Exception: if self.eResultPrivate.isNil: # for example Result.default()! - raise (ref ResultError[void])(msg: "Trying to access value with err (nil)") + raise (ref ResultDefect)(msg: "Trying to access value with err (nil)") raise self.eResultPrivate elif E is void: raise (ref ResultError[void])(msg: "Trying to access value with err")