codex-storage / questionable

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

Better compilation error when calling `without` with wrong parameter #40

Closed markspanbroek closed 1 year ago

markspanbroek commented 1 year ago

Give a better compiler error when calling without with an error identifier that is not an identifier.

This can happen when a user types something like this:

without foo =? bar(), error + 1: # "error + 1" is not an identifier
  discard

Or when a template is evaluated before the without macro is evaluated:

template err =
  "some string"

without foo =? bar(), err: # "some string" is not an identifier
  discard

Fixes #39