mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-16 22:11:18 +00:00
fixes #304
This commit is contained in:
@@ -8,3 +8,11 @@ template t() = echo(foo)
|
||||
|
||||
var foo = 12
|
||||
t()
|
||||
|
||||
|
||||
template test_in(a, b, c: expr): bool {.immediate, dirty.} =
|
||||
var result {.gensym.}: bool = false
|
||||
false
|
||||
|
||||
when isMainModule:
|
||||
assert test_in(ret2, "test", str_val)
|
||||
|
||||
@@ -25,3 +25,11 @@ var x = stdin.readline.split.map(parseInt).max
|
||||
echo x, " is the maximum!"
|
||||
echo "another number: ", takeParseInt(parseInt)
|
||||
|
||||
|
||||
type
|
||||
TFoo[a,b] = object
|
||||
lorem: a
|
||||
ipsum: b
|
||||
|
||||
proc bar[a,b](f: TFoo[a,b], x: a) = echo(x, " ", f.lorem, f.ipsum)
|
||||
proc bar[a,b](f: TFoo[a,b], x: b) = echo(x, " ", f.lorem, f.ipsum)
|
||||
|
||||
Reference in New Issue
Block a user