summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2017-03-24 15:25:11 +0200
committerZahary Karadjov <zahary@gmail.com>2017-03-24 17:07:30 +0200
commite31575c27a7ef9543257aa613515fff7adf4ac84 (patch)
treef01df6bbc8ae765439f722a8bfa6685b85a08b42 /tests
parent905a22d137288bea8017dff42381b64fbe6387cb (diff)
downloadNim-e31575c27a7ef9543257aa613515fff7adf4ac84.tar.gz
close #1147
Diffstat (limited to 'tests')
-rw-r--r--tests/concepts/tmisc_issues.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/concepts/tmisc_issues.nim b/tests/concepts/tmisc_issues.nim
new file mode 100644
index 000000000..fad1cd6a7
--- /dev/null
+++ b/tests/concepts/tmisc_issues.nim
@@ -0,0 +1,16 @@
+discard """
+output: '''true'''
+"""
+
+# https://github.com/nim-lang/Nim/issues/1147
+type TTest = object
+  vals: seq[int]
+
+proc add*(self: var TTest, val: int) =
+  self.vals.add(val)
+
+type CAddable = concept x
+  x[].add(int)
+
+echo((ref TTest) is CAddable)
+