Nim icon indicating copy to clipboard operation
Nim copied to clipboard

Inline typeclass not considered a typedesc

Open beef331 opened this issue 4 years ago • 0 comments
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"

beef331 avatar Jun 05 '21 05:06 beef331