codex-storage / questionable

Elegant optional types for Nim
Other
116 stars 5 forks source link

Fix error when using an existing name as error variable #22

Closed markspanbroek closed 2 years ago

markspanbroek commented 2 years ago

Using without in combination with generics and an existing name would result in a compiler error.

Example:

let existingName {.used.} = "some variable"

proc shouldCompile(_: type int): ?!int =
  without _ =? int.failure "error", existingName: # compiler error
     # ...

Fixes #19