summary refs log tree commit diff stats
path: root/tests/generics/tgenericprop.nim
blob: 21ffdf289019e9992c3ac572a1525a331777fde5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
type
  TProperty[T] = object of RootObj
    getProc: proc(property: TProperty[T]): T {.nimcall.}
    setProc: proc(property: TProperty[T], value: T) {.nimcall.}
    value: T

proc newProperty[T](value: RootObj): TProperty[T] =
  result.getProc = proc (property: TProperty[T]) =
    return property.value