no generic parameters allowed for ref #4395

yglukhov opened this Issue Jun 22, 2016 · 1 comment


None yet

1 participant


Don't know how to describe this issue correctly.

import macros
import typetraits

template foo(t: typedesc) =

macro myMacro(p: typed): stmt =
  result = newNimNode(nnkStmtList)
  let t = getType(p)
  for i in 2 ..< t.len:
    result.add(newCall("foo", newCall("type", (t[i]))))

type O = ref int # Replace with "type O = int" to make it work

proc test(i: cint, p: proc(a: O)) =
test.nim(16, 10) template/generic instantiation from here
test.nim(9, 18) Error: no generic parameters allowed for ref
@Araq Araq closed this in 5f4e98b Jun 23, 2016

@Araq, thanks for the fix! It works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment