When a type has a $ proc that might produce side effects, then a without statement that tries to bind this type fails with a compilation error:
results.nim(373, 6) Error: 'raiseResultDefect' can have side effects
This fix avoids invoking the raiseResultDefect func by using .unsafeError instead of .error . It's ok to use unsafeError in bindFailed, because we've already checked that the result contains an error.
When a type has a
$
proc that might produce side effects, then awithout
statement that tries to bind this type fails with a compilation error:This fix avoids invoking the
raiseResultDefect
func by using.unsafeError
instead of.error
. It's ok to useunsafeError
inbindFailed
, because we've already checked that the result contains an error.