This commit is contained in:
Tanguy 2022-06-16 18:09:50 +02:00
parent ba353b27e4
commit 8fbf39a60f
No known key found for this signature in database
GPG Key ID: 7DD8EC6B6CE6C45E
2 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ template `|?`*[T,E](value: Result[T,E], fallback: T): T =
template unpack*(expression: Result): untyped =
let res = expression
when declaredInScope(internalWithoutError):
when declared(internalWithoutError):
if res.isFailure:
internalWithoutError = res.error
unpack(res.option)

View File

@ -25,7 +25,7 @@ template without*(condition, errorname, body) =
var internalWithoutError {.inject.}: ref CatchableError
else:
internalWithoutError = nil
without condition:
template errorname: ref CatchableError = internalWithoutError
if isNil(errorname):