summary refs log tree commit diff stats
path: root/tests/stmt
Commit message (Expand)AuthorAgeFilesLines
* fix #15972 (#15994)flywind2020-11-183-0/+32
itter Grzegorz Adam Hankiewicz <gradha@imap.cc> 2013-07-02 12:28:22 +0200 Adds idetools --suggest test case. Refs #484.' href='/ahoang/Nim/commit/tests/caas/completion_dot_syntax_main.nim?h=devel&id=f7f14081682a24cf110ed7acd907ab2e17834b97'>f7f140816 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24























                                                                            
import strutils

# Verifies if the --suggestion switch differentiates types for dot notation.

type
  TDollar = distinct int
  TEuro = distinct int

proc echoRemainingDollars(amount: TDollar) =
  echo "You have $1 dollars" % [$int(amount)]

proc echoRemainingEuros(amount: TEuro) =
  echo "You have $1 euros" % [$int(amount)]

proc echoRemainingBugs() =
  echo "You still have bugs"

proc main =
  var
    d: TDollar
    e: TEuro
  d = TDollar(23)
  e = TEuro(32)
  d.echoRemainingDollars()