mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 10:52:14 +00:00
This commit returns to a bit less strict checking of the number of macro arguments, because some old immediate macros rely on a behavior where even the arity of the macro is not being checked. It may be better if such macros are just declared to use varargs[expr], but this remains for another day.
26 lines
501 B
Nim
26 lines
501 B
Nim
discard """
|
|
cmd: "nim check $file"
|
|
errormsg: "'m' has unspecified generic parameters"
|
|
nimout: '''
|
|
t5167_5.nim(20, 9) Error: 't' has unspecified generic parameters
|
|
t5167_5.nim(21, 5) Error: 't' has unspecified generic parameters
|
|
t5167_5.nim(23, 9) Error: 'm' has unspecified generic parameters
|
|
t5167_5.nim(24, 5) Error: 'm' has unspecified generic parameters
|
|
'''
|
|
"""
|
|
|
|
template t[B]() =
|
|
echo "foo1"
|
|
|
|
macro m[T]: stmt = nil
|
|
|
|
proc bar(x: proc (x: int)) =
|
|
echo "bar"
|
|
|
|
let x = t
|
|
bar t
|
|
|
|
let y = m
|
|
bar m
|
|
|