diff options
author | Araq <rumpf_a@web.de> | 2018-10-02 23:31:39 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-10-02 23:31:39 +0200 |
commit | 7ac1e6e52860dd511fdaa2db52f4213c232bf616 (patch) | |
tree | 5129a1da2266b16f204342c995c7f8c1a543dcdf /tests/method | |
parent | f673fbd91fa8b75e71feff0df232f6c598653722 (diff) | |
download | Nim-7ac1e6e52860dd511fdaa2db52f4213c232bf616.tar.gz |
fixes #5479
Diffstat (limited to 'tests/method')
-rw-r--r-- | tests/method/tgeneric_methods.nim | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/method/tgeneric_methods.nim b/tests/method/tgeneric_methods.nim index 76a68fbb0..0e2aeeede 100644 --- a/tests/method/tgeneric_methods.nim +++ b/tests/method/tgeneric_methods.nim @@ -1,5 +1,7 @@ discard """ - output: "wow2" + output: '''wow2 +X 1 +X 3''' """ type First[T] = ref object of RootObj @@ -22,3 +24,18 @@ proc takeFirst(x: First[int]) = wow(2, x) takeFirst(x) + + +# bug #5479 +type + Base[T: static[int]] = ref object of RootObj + +method test[T](t: Base[T]) {.base.} = + echo "X ", t.T + +let ab = Base[1]() + +ab.test() + +let ac = Base[3]() +ac.test() |