summary refs log tree commit diff stats
path: root/tests/concepts/t6770.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/concepts/t6770.nim')
-rw-r--r--tests/concepts/t6770.nim27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/concepts/t6770.nim b/tests/concepts/t6770.nim
new file mode 100644
index 000000000..1787ee670
--- /dev/null
+++ b/tests/concepts/t6770.nim
@@ -0,0 +1,27 @@
+discard """
+output: '''
+10
+10
+'''
+"""
+
+type GA = concept c
+  c.a is int
+
+type A = object
+  a: int
+
+type AA = object
+  case exists: bool
+  of true:
+    a: int
+  else:
+    discard
+
+proc print(inp: GA) =
+  echo inp.a
+
+let failing = AA(exists: true, a: 10)
+let working = A(a:10)
+print(working)
+print(failing)