t17433.nim 407 B

1234567891011121314151617
  1. # Inside template bodies, ensure return types referencing a param are replaced.
  2. # This helps guarantee that return parameter analysis happens after argument
  3. # analysis.
  4. # bug #17433
  5. from std/macros import expandMacros
  6. proc bar(a: typedesc): a = default(a)
  7. doAssert bar(float) == 0.0
  8. doAssert bar(string) == ""
  9. template main =
  10. proc baz(a: typedesc): a = default(a)
  11. doAssert baz(float) == 0.0
  12. main()