diff --git a/tests/concepts/t8012.nim b/tests/concepts/t8012.nim new file mode 100644 index 0000000000..ec2aa6e5c5 --- /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