summary refs log tree commit diff stats
path: root/tests/errmsgs/tgenericconstraint.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errmsgs/tgenericconstraint.nim')
-rw-r--r--tests/errmsgs/tgenericconstraint.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/errmsgs/tgenericconstraint.nim b/tests/errmsgs/tgenericconstraint.nim
new file mode 100644
index 000000000..b51fb3488
--- /dev/null
+++ b/tests/errmsgs/tgenericconstraint.nim
@@ -0,0 +1,14 @@
+discard """
+  errormsg: "cannot instantiate B"
+  nimout: '''
+got: <typedesc[int]>
+but expected: <T: string or float>
+'''
+"""
+
+type
+  B[T: string|float] = object
+    child: ref B[T]
+
+var b: B[int]
+