completion_dot_syntax_dirty.nim 505 B

1234567891011121314151617181920212223242526
  1. import strutils
  2. # Verifies if the --suggestion switch differentiates types for dot notation.
  3. type
  4. TDollar = distinct int
  5. TEuro = distinct int
  6. proc echoRemainingDollars(amount: TDollar) =
  7. echo "You have $1 dollars" % [$int(amount)]
  8. proc echoRemainingEuros(amount: TEuro) =
  9. echo "You have $1 euros" % [$int(amount)]
  10. proc echoRemainingBugs() =
  11. echo "You still have bugs"
  12. proc main =
  13. var
  14. d: TDollar
  15. e: TEuro
  16. d = TDollar(23)
  17. e = TEuro(32)
  18. d.echoRemainingDollars()
  19. e.echoRemai