Adds idetoos testcase to verify returned signatures.

At the moment too many of them return proc.
This commit is contained in:
Grzegorz Adam Hankiewicz
2013-06-16 13:18:09 +02:00
parent d2def332fd
commit b15f585273
3 changed files with 50 additions and 1 deletions

2
.gitignore vendored
View File

@@ -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")

View File

@@ -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

View File

@@ -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 \(