diff options
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/tfieldindex.nim | 2 | ||||
-rw-r--r-- | tests/run/tfinally.nim | 10 | ||||
-rw-r--r-- | tests/run/tstaticparams.nim | 17 |
3 files changed, 21 insertions, 8 deletions
diff --git a/tests/run/tfieldindex.nim b/tests/run/tfieldindex.nim index 3ffa65e58..f0674af54 100644 --- a/tests/run/tfieldindex.nim +++ b/tests/run/tfieldindex.nim @@ -5,7 +5,7 @@ discard """ type TMyTuple = tuple[a, b: int] -proc indexOf*(t: typedesc, name: string): int {.compiletime.} = +proc indexOf*(t: typedesc, name: string): int = ## takes a tuple and looks for the field by name. ## returs index of that field. var diff --git a/tests/run/tfinally.nim b/tests/run/tfinally.nim index 273aac72b..16fb3e7da 100644 --- a/tests/run/tfinally.nim +++ b/tests/run/tfinally.nim @@ -1,8 +1,6 @@ discard """ file: "tfinally.nim" - output: '''came -here -3''' + output: "came\nhere\n3" """ # Test return in try statement: @@ -14,10 +12,8 @@ proc main: int = echo("came") return 2 finally: - echo("here ") + echo("here") return 3 - -echo main() #OUT came here 3 - +echo main() #OUT came here 3 diff --git a/tests/run/tstaticparams.nim b/tests/run/tstaticparams.nim new file mode 100644 index 000000000..3e501ed8b --- /dev/null +++ b/tests/run/tstaticparams.nim @@ -0,0 +1,17 @@ +discard """ + file: "tstaticparams.nim" + output: "abracadabra\ntest" +""" + +type + TFoo[T; Val: expr[string]] = object + data: array[4, T] + +proc takeFoo(x: TFoo) = + echo "abracadabra" + echo TFoo.Val + +var x: TFoo[int, "test"] + +takeFoo(x) + |