Matches when the call passed exactly count arguments.

Parameters

number
required
The exact argument count. Must be a whole number of 0 or more.

Properties

number
The required count. Writable.

Behavior

  • Explicit nil counts. Calling f(1, nil) passes two arguments, so it matches ArgCountFilter.new(2) and not ArgCountFilter.new(1).
  • Namecalls include the object. Inside a __namecall, obj:Method(a) counts as two arguments, because the object itself is argument 1.

Example

Errors