Nim
Nim copied to clipboard
Inline typeclass not considered a typedesc
trafficstars
If one attempts to pass int or float into a macro which takes a typedesc it does not compile.
Example
macro test(a: typedesc) = discard
test(int or float)
Current Output
Error: type mismatch: got <int or float>
but expected one of:
macro test(a: type)
first type mismatch at position: 1
required type for a: typedesc
but expression '[type node]' is of type: int or float
expression: test([type node])
Expected Output
I imagine it should compile and pass in:
Infix
Ident"or"
Sym"int"
Sym"float"