make tests green again

This commit is contained in:
Andreas Rumpf 2018-09-24 12:14:43 +02:00
commit 9364369c1f
9 changed files with 34 additions and 25 deletions

View file

@ -1,18 +1,18 @@
discard """
cmd: "nim check $file"
errormsg: "'m' has unspecified generic parameters"
errormsg: "'t' has unspecified generic parameters"
nimout: '''
t5167_5.nim(20, 9) Error: 't' has unspecified generic parameters
t5167_5.nim(21, 5) Error: 't' has unspecified generic parameters
t5167_5.nim(23, 9) Error: 'm' has unspecified generic parameters
t5167_5.nim(24, 5) Error: 'm' has unspecified generic parameters
'''
"""
template t[B]() =
echo "foo1"
macro m[T]: stmt = nil
macro m[T]: untyped = nil
proc bar(x: proc (x: int)) =
echo "bar"

View file

@ -9,8 +9,8 @@ proc noret1*(i: int) {.noreturn.} =
proc noret2*(i: int): void {.noreturn.} =
echo i
noret1(1)
noret2(2)
if true: noret1(1)
if true: noret2(2)
var p {.used.}: proc(i: int): int
doAssert(not compiles(

View file

@ -14,10 +14,10 @@ echo callWithFoo(0)
echo(CA+CD)
echo useTypes(TA(x:TB(x:1)), 2)
second(0)
template callWithFoo(arg: untyped): untyped =
foo(arg)
proc first(i: int): void
proc second(i: int): void =
@ -35,7 +35,7 @@ type
type
TCyclicA = ref object
x: TDoubleCyclic
type
TCyclicB = ref object
x: TDoubleCyclic

View file

@ -1,11 +1,11 @@
discard """
output: '''3030
output: '''0
true
3'''
"""
template arithOps: untyped = (`+` | `-` | `*`)
template testOr{ (arithOps{f})(a, b) }(a, b, f: untyped): untyped = f(a+1, b)
template testOr{ (arithOps{f})(a, b) }(a, b, f: untyped): untyped = f(a mod 10, b)
let xx = 10
echo 10*xx

View file

@ -3,8 +3,4 @@ errormsg: "invalid type: 'object' for var"
line: 6
"""
var a: object a: int
# or
var b: ref object a: int
# or
var c: ptr object a: int
var a: object