summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-08-30 11:26:23 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-09-01 13:02:53 +0200
commitf6a2ff731b8d7288542d8dff93937c68d721edd1 (patch)
tree547c3a011b6e046f2db4133679f859bcf8c19a3e /tests
parent0a90613288e4944cdae032ff3fea8fd0829a2e20 (diff)
downloadNim-f6a2ff731b8d7288542d8dff93937c68d721edd1.tar.gz
fixes #4672
Diffstat (limited to 'tests')
-rw-r--r--tests/generics/ttypeclass_to_typeclass.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/generics/ttypeclass_to_typeclass.nim b/tests/generics/ttypeclass_to_typeclass.nim
new file mode 100644
index 000000000..a5f010450
--- /dev/null
+++ b/tests/generics/ttypeclass_to_typeclass.nim
@@ -0,0 +1,12 @@
+# bug #4672
+type
+  EnumContainer[T: enum] = object
+    v: T
+  SomeEnum {.pure.} = enum
+    A,B,C
+
+proc value[T: enum](this: EnumContainer[T]): T =
+  this.v
+
+var enumContainer: EnumContainer[SomeEnum]
+discard enumContainer.value()