summary refs log tree commit diff stats
path: root/tests/generics
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2018-06-14 12:47:07 +0300
committerZahary Karadjov <zahary@gmail.com>2018-06-16 16:46:32 +0300
commite719f211c634d2be7b5ae118db7051a2382a8e3e (patch)
treebbde8228711c168670bcb7ff84778b9d2f474e54 /tests/generics
parent59d19946c034d343ab4f5b8ad57683ff9f80de85 (diff)
downloadNim-e719f211c634d2be7b5ae118db7051a2382a8e3e.tar.gz
fix #6928; fix #7208
Diffstat (limited to 'tests/generics')
-rw-r--r--tests/generics/tlateboundgenericparams.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/generics/tlateboundgenericparams.nim b/tests/generics/tlateboundgenericparams.nim
index 02f99dc55..9f0580fd2 100644
--- a/tests/generics/tlateboundgenericparams.nim
+++ b/tests/generics/tlateboundgenericparams.nim
@@ -1,3 +1,11 @@
+discard """
+  output: "1\n10\n1\n10"
+  nimout: '''
+bar instantiated with 1
+bar instantiated with 10
+'''
+"""
+
 import typetraits
 
 type
@@ -122,3 +130,16 @@ when true:
     var p = getOrigin[float]()
     var rotated = p.rotate(2.1)
 
+  test 7:
+    proc bar(x: static[int]) =
+      static: echo "bar instantiated with ", x
+      echo x
+
+    proc foo(x: static[int] = 1) =
+      bar(x)
+
+    foo()
+    foo(10)
+    foo(1)
+    foo(10)
+