fix some trivial errors in the test suite and some more regressions caused by tyTypeDesc[tyNone]

This commit is contained in:
Zahary Karadjov 2014-02-18 02:46:14 +02:00
commit cda92048ba
10 changed files with 68 additions and 37 deletions

View file

@ -1,5 +1,5 @@
discard """
output: "10\n10"
output: "10\n10\n1\n2\n3"
"""
proc test(x: proc (a, b: int): int) =
@ -8,3 +8,11 @@ proc test(x: proc (a, b: int): int) =
test(proc (a, b): auto = a + b)
test do (a, b) -> auto: a + b
proc foreach[T](s: seq[T], body: proc(x: T)) =
for e in s:
body(e)
foreach(@[1,2,3]) do (x):
echo x

View file

@ -0,0 +1,15 @@
type
TObj*[T] = object
val*: T
var
totalGlobals* = 0
proc makeObj[T](x: T): TObj[T] =
totalGlobals += 1
result.val = x
proc globalInstance*[T]: var TObj[T] =
var g {.global.} = when T is int: makeObj(10) else: makeObj("hello")
result = g

View file

@ -0,0 +1,4 @@
import globalaux
echo "in globalaux2: ", globalInstance[int]().val

View file

@ -1,7 +1,7 @@
discard """
file: "tests/reject/trecincb.nim"
line: 9
errormsg: "recursive dependency: 'tests/reject/trecincb.nim'"
errormsg: "recursive dependency: 'tests/module/trecincb.nim'"
"""
# Test recursive includes

View file

@ -1,7 +1,7 @@
discard """
file: "trecincb.nim"
line: 9
errormsg: "recursive dependency: 'tests/reject/trecincb.nim'"
errormsg: "recursive dependency: 'tests/module/trecincb.nim'"
"""
# Test recursive includes

View file

@ -183,7 +183,7 @@ type
channel: string
timestamp: TTime
case kind*: TSeenType
of PSeenJoin: discard
of PSeenJoin: nil
of PSeenPart, PSeenQuit, PSeenMsg:
msg: string
of PSeenNick:

View file

@ -1,5 +1,9 @@
discard """
output: "he, no return type;abc a string"
output: '''12
empty
he, no return type;
abc a string
ha'''
"""
proc ReturnT[T](x: T): T =