You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
proc allows calling proc fun*[N: static int](): auto = with fun[2] but not macro or template
case2b is fishy as N:int syntax accepts both 2 and int
import std/macros
whendefined(case1):
# Error: type expectedmacrofun*[N: staticint](): untyped=# 1 # original bug reportnewLit1# EDITconst a =fun[2]()
whendefined(case2):
# compiles: okprocfun*[N: staticint](): auto=1const a =fun[2]()
whendefined(case2b):
# compiles, but this exposes an ambiguity in `N:int` syntax as it accepts both 2 and intprocfun*[N: int](): auto=1const a =fun[2]()
const a2 =fun[int]()
whendefined(case3):
# Error: type expectedtemplatefun*[N: staticint](): untyped=1const a =fun[2]()
whendefined(case3b):
# Error: type expectedtemplatefun*[N: int](): untyped=1const a =fun[2]()