-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
Description
proc wrap(fn: static proc: int): proc: int =
fn
# --- works fine with `normal proc` ---
# proc c1: int = 1
# proc c2: int = 2
const
c1 = proc: int = 1
c2 = proc: int = 2
wrapped_c1 = wrap c1
wrapped_c2 = wrap c2
when isMainModule:
echo c2 == c1
echo c2() == c1()
echo wrapped_c2 == wrapped_c1
echo wrapped_c2() == wrapped_c1()
echo wrapped_c1()
echo wrapped_c2()
Nim Version
Nim Compiler Version 1.6.10 [Windows: amd64]
Compiled at 2022-11-21
Current Output
false
false
true
true
1
1
Expected Output
false
false
false
false
1
2
Additional Information
without static
and const
everything works fine.