t23032_2.nim 373 B

123456789101112131415161718192021
  1. discard """
  2. action: "reject"
  3. errormsg: "ambiguous identifier: '%*'"
  4. """
  5. import std/macros
  6. type A[T, H] = object
  7. proc `%*`[T](a: A) = discard
  8. proc `%*`[T](a: A[int, T]) = discard
  9. macro collapse(s: typed) = discard
  10. macro startHere(n: untyped): untyped =
  11. result = newStmtList()
  12. let s = n[0]
  13. result.add quote do:
  14. collapse(`s`.typeof())
  15. startHere(`a` %* `b`)