diff options
author | Dominik Picheta <dominikpicheta@gmail.com> | 2016-01-16 13:58:40 +0000 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@gmail.com> | 2016-01-16 13:58:40 +0000 |
commit | 19ea2672c545288c8cf4b4bd925ed3fd3bdd88b2 (patch) | |
tree | cf36fff2fb5256e0ea691dfba14469ca56d81ff6 /tests/closure | |
parent | ac71ece6738b14019d0512b4d93394cea2ab924d (diff) | |
download | Nim-19ea2672c545288c8cf4b4bd925ed3fd3bdd88b2.tar.gz |
Added test for #1846.
Diffstat (limited to 'tests/closure')
-rw-r--r-- | tests/closure/tissue1846.nim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/closure/tissue1846.nim b/tests/closure/tissue1846.nim new file mode 100644 index 000000000..3fbef169d --- /dev/null +++ b/tests/closure/tissue1846.nim @@ -0,0 +1,16 @@ +type + TBinOp*[T] = proc (x,y: T): bool + + THeap*[T] = object + cmp*: TBinOp[T] + +proc less*[T](x,y: T): bool = + x < y + +proc initHeap*[T](cmp: TBinOp[T]): THeap[T] = + result.cmp = cmp + +when isMainModule: + var h = initHeap[int](less[int]) + + echo h.cmp(2,3) \ No newline at end of file |