summary refs log blame commit diff stats
path: root/tests/compile/tgenericprop.nim
blob: 7cddf56175a340cb49edbde95094b1d887f45ead (plain) (tree)
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