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 | |
parent | d2def332fd6d290bd74cb1e491b3c8f8f09d894a (diff) | |
download | Nim-b15f585273092f05145dd5b3fec5e83e27fbe45a.tar.gz |
Adds idetoos testcase to verify returned signatures.
At the moment too many of them return proc.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | tests/caas/its_full_of_procs.nim | 29 | ||||
-rw-r--r-- | tests/caas/its_full_of_procs.txt | 20 |
3 files changed, 50 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore index a52319eff..dcb94935f 100644 --- a/.gitignore +++ b/.gitignore @@ -173,7 +173,7 @@ examples/cross_calculator/android/tags /tests/caas/issue_416_template_shift /tests/caas/issue_452_export_shift /tests/caas/issue_477_dynamic_dispatch +/tests/caas/its_full_of_procs /tests/caas/main /tests/caasdriver /tools/nimgrep -no changes added to commit (use "git add" and/or "git commit -a") 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 diff --git a/tests/caas/its_full_of_procs.txt b/tests/caas/its_full_of_procs.txt new file mode 100644 index 000000000..31a2d3baa --- /dev/null +++ b/tests/caas/its_full_of_procs.txt @@ -0,0 +1,20 @@ +its_full_of_procs.nim + +> idetools --track:$TESTNIM,26,15 --def $SILENT +skProc +proc \( + +> idetools --track:$TESTNIM,27,21 --def $SILENT +skIterator +iterator \( +!proc \( + +> idetools --track:$TESTNIM,29,0 --def $SILENT +skMethod +method \( +!proc \( + +> idetools --track:$TESTNIM,27,15 --def $SILENT +skTemplate +template \( +!proc \( |