You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the without statement
on an expression that returns Result
whereby you access the error
inside generic code.
Failure
The error is set to nil, whereas it should have a value
Reproduce
test"without statement works in generic code":
proctest(_: type) =without a =?int.failure"error", e:
check e.msg =="error"return
fail
test(int)
Removing the generic parameter makes the test pass.
Possible cause
Replacing infix operator =? with override=? override doesn't seem to work. It seems that the =? has already been evaluated by the compiler before it evaluates the without template.
Context
Use the
without
statementon an expression that returns
Result
whereby you access the error
inside generic code.
Failure
The error is set to nil, whereas it should have a value
Reproduce
Removing the generic parameter makes the test pass.
Possible cause
Replacing infix operator
=?
withoverride=?
override doesn't seem to work. It seems that the=?
has already been evaluated by the compiler before it evaluates thewithout
template.https://github.com/status-im/questionable/blob/d7e9f0bf7fec14df13a26e699437a2fe577b26ba/questionable/withoutresult.nim#L37
The text was updated successfully, but these errors were encountered: