tauto_excessive.nim 278 B

123456789101112131415161718192021
  1. discard """
  2. output: '''10
  3. 10.0
  4. 1.0hiho'''
  5. """
  6. # bug #3224
  7. proc f(x: auto): auto =
  8. result = $(x+10)
  9. proc f(x, y: auto): auto =
  10. result = $(x+y)
  11. echo f(0) # prints 10
  12. echo f(0.0) # prints 10.0
  13. proc `+`(a, b: string): string = a & b
  14. echo f(0.7, 0.3), f("hi", "ho")