use typed nodes in untyped arg of nim macros

Viewed 28

i have following code, but it's not working if args untyped and raise Error: node is not a symbol

import macros

macro test(body: untyped): untyped=
     for i in body:
        echo getImpl(i).repr
const a = [[44, 55], [5, 6]]
const b = [1, 2, 3, 4]
test:
    a
    b

if i replace untyped to typed on following code it works:

test:
    a

but if i replace it by this

test:
    a
    b

it's produce Error: expression 'a' is of type 'array[0..1, array[0..1, int]]' and has to be used (or discarded)

0 Answers
Related