fixes #4555
This commit is contained in:
parent
24b72cebe7
commit
de6198c747
8 changed files with 38 additions and 14 deletions
17
tests/lookups/test.nim
Normal file
17
tests/lookups/test.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# This file needs to be called 'test' nim to provoke a clash
|
||||
# with the unittest.test name. Issue #
|
||||
|
||||
import unittest, macros
|
||||
|
||||
# bug #4555
|
||||
|
||||
macro memo(n: untyped): typed =
|
||||
result = n
|
||||
|
||||
proc fastFib(n: int): int {.memo.} = 40
|
||||
proc fib(n: int): int = 40
|
||||
|
||||
suite "memoization":
|
||||
test "recursive function memoization":
|
||||
check fastFib(40) == fib(40)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue