mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 10:52:14 +00:00
16 lines
211 B
Nim
16 lines
211 B
Nim
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
|