From e31575c27a7ef9543257aa613515fff7adf4ac84 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Fri, 24 Mar 2017 15:25:11 +0200 Subject: [PATCH] close #1147 --- tests/concepts/tmisc_issues.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/concepts/tmisc_issues.nim 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) +