diff options
Diffstat (limited to 'tests/proc')
-rw-r--r-- | tests/proc/tnestprc.nim | 16 | ||||
-rw-r--r-- | tests/proc/tprocredef.nim | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/proc/tnestprc.nim b/tests/proc/tnestprc.nim new file mode 100644 index 000000000..c10ad6abf --- /dev/null +++ b/tests/proc/tnestprc.nim @@ -0,0 +1,16 @@ +discard """ + file: "tnestprc.nim" + output: "10" +""" +# Test nested procs without closures + +proc Add3(x: int): int = + proc add(x, y: int): int {.noconv.} = + result = x + y + + result = add(x, 3) + +echo Add3(7) #OUT 10 + + + diff --git a/tests/proc/tprocredef.nim b/tests/proc/tprocredef.nim new file mode 100644 index 000000000..86ed92b62 --- /dev/null +++ b/tests/proc/tprocredef.nim @@ -0,0 +1,9 @@ +discard """ + file: "tprocredef.nim" + line: 8 + errormsg: "redefinition of \'foo\'" +""" + +proc foo(a: int, b: string) = nil +proc foo(a: int, b: string) = nil + |