You can use asserts:
let b: byte = 42'u8
let c = 42'u16
proc test*[T](t: T): bool =
assert(sizeof(T) == 1, "invalid parameter size: " & $sizeof(T))
result = true
echo test(b)
echo test(c)
- Can I somehow show context-specific information in an {.error.} ? monster
- Re: Can I somehow show context-specific information in an {.e... stisa
