completion_dot_syntax_main.nim 491 B

12345678910111213141516171819202122232425
  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()