add testcase for #8012 (#15785)

(cherry picked from commit 2de90a14cb)
This commit is contained in:
flywind
2020-10-30 16:57:26 +08:00
committed by narimiran
parent dc6073b0b8
commit eb2ed782c6

15
tests/concepts/t8012.nim Normal file
View File

@@ -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