Closed tersec closed 10 months ago
Workaround: qualify the error
access inside valueOr
:
proc makeBeaconBlockForHeadAndSlot[T](): Result[int, string] =
var gps: Result[int, string]
discard gps.valueOr:
return err(gps.error)
return err("")
For example, results in an error of:
but if one makes
makeBeaconBlockForHeadAndSlot
non-generic, it compiles fine, even though it doesn't use its dummy parameter regardless.It's the result of conflict between the
error
func
and injected symbol, which is a known Nim issue. Reproduced inin a self-contained way.