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

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