mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
15
tests/concepts/t8012.nim
Normal file
15
tests/concepts/t8012.nim
Normal 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
|
||||
Reference in New Issue
Block a user