t8545.nim 436 B

123456789101112131415161718192021222324
  1. discard """
  2. targets: "c cpp js"
  3. """
  4. # bug #8545
  5. template bar(a: static[bool]): untyped = int
  6. proc main() =
  7. proc foo1(a: static[bool]): auto = 1
  8. doAssert foo1(true) == 1
  9. proc foo2(a: static[bool]): bar(a) = 1
  10. doAssert foo2(true) == 1
  11. proc foo3(a: static[bool]): bar(cast[static[bool]](a)) = 1
  12. doAssert foo3(true) == 1
  13. proc foo4(a: static[bool]): bar(static(a)) = 1
  14. doAssert foo4(true) == 1
  15. static: main()
  16. main()