summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-05-13 19:24:27 +0200
committerAndreas Rumpf <rumpf_a@web.de>2015-05-13 19:24:27 +0200
commitf293e2c152db01291c6a94e3df790af7da1c85fc (patch)
tree8167c4cc1854b9d2c894e2cec97f337697a62bf8 /tests
parent0bf78e262950aeaa97bf3b64e88728a5681fd2e5 (diff)
parenta8fbaf917b854876a01782c644e01ab2e90c5d9f (diff)
downloadNim-f293e2c152db01291c6a94e3df790af7da1c85fc.tar.gz
Merge pull request #2708 from nanoant/patch/dont-convert-subtype-typedesc-params
Fix #2662: Don't convert subtype typedesc params
Diffstat (limited to 'tests')
-rw-r--r--tests/metatype/ttypedesc3.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/metatype/ttypedesc3.nim b/tests/metatype/ttypedesc3.nim
new file mode 100644
index 000000000..3d40b25b2
--- /dev/null
+++ b/tests/metatype/ttypedesc3.nim
@@ -0,0 +1,19 @@
+import typetraits
+
+type
+  Base = object of RootObj
+  Child = object of Base
+
+proc pr(T: typedesc[Base]) = echo "proc " & T.name
+method me(T: typedesc[Base]) = echo "method " & T.name
+iterator it(T: typedesc[Base]) = yield "yield " & T.name
+
+Base.pr
+Child.pr
+
+Base.me
+when false:
+  Child.me #<- bug #2710
+
+for s in Base.it: echo s
+for s in Child.it: echo s #<- bug #2662