diff options
author | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2013-06-16 13:18:09 +0200 |
---|---|---|
committer | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2013-06-16 22:39:38 +0200 |
commit | b15f585273092f05145dd5b3fec5e83e27fbe45a (patch) | |
tree | e3923fa40fed510a7a0a99a11404dfaf8f19f06d /tests/caas/its_full_of_procs.nim | |
parent | d2def332fd6d290bd74cb1e491b3c8f8f09d894a (diff) | |
download | Nim-b15f585273092f05145dd5b3fec5e83e27fbe45a.tar.gz |
Adds idetoos testcase to verify returned signatures.
At the moment too many of them return proc.
Diffstat (limited to 'tests/caas/its_full_of_procs.nim')
-rw-r--r-- | tests/caas/its_full_of_procs.nim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/caas/its_full_of_procs.nim b/tests/caas/its_full_of_procs.nim new file mode 100644 index 000000000..45347490c --- /dev/null +++ b/tests/caas/its_full_of_procs.nim @@ -0,0 +1,29 @@ +import unicode, sequtils + +# This example shows that idetools returns proc as signature for everything +# which can be called. While a clever person would use the second column to +# differentiate betwen procs, methods and others, why does the output contain +# incorrect information? + +type + TThing = object of TObject + TUnit = object of TThing + x: int + +method collide(a, b: TThing) {.inline.} = + quit "to override!" + +method collide(a: TThing, b: TUnit) {.inline.} = + echo "1" + +method collide(a: TUnit, b: TThing) {.inline.} = + echo "2" + +var + a, b: TUnit + +let + input = readFile("its_full_of_procs.nim") + letters = toSeq(runes(string(input))) + +collide(a, b) # output: 2 |