diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-10-30 16:57:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 09:57:26 +0100 |
commit | 2de90a14cbc5182efad2cff63cd33f820e3a8832 (patch) | |
tree | 91e8f65d70202daad5919f609cf146524c793a04 /tests/concepts/t8012.nim | |
parent | 1655c04aa3b980bf0a9d65bf658c19efa6af7d94 (diff) | |
download | Nim-2de90a14cbc5182efad2cff63cd33f820e3a8832.tar.gz |
add testcase for #8012 (#15785)
Diffstat (limited to 'tests/concepts/t8012.nim')
-rw-r--r-- | tests/concepts/t8012.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/concepts/t8012.nim b/tests/concepts/t8012.nim new file mode 100644 index 000000000..ec2aa6e5c --- /dev/null +++ b/tests/concepts/t8012.nim @@ -0,0 +1,15 @@ +type + MyTypeCon = concept c + c.counter is int + MyType = object + counter: int + +proc foo(conc: var MyTypeCon) = + conc.counter.inc + if conc.counter < 5: + foo(conc) + +var x: MyType + +x.foo +discard x.repr |