PositionalArguments extension

How generated code reads an optional positional argument from the list of an IntrospectedConstructor or IntrospectedMethod call, as Function.apply passes it: the value when the list is long enough, else the parameter's default.

// Generated: greet(arguments[0] as String, arguments.argumentOr(1, 1))
on

Methods

argumentOr<T>(int index, T absent) → T

Available on List<Object?>, provided by the PositionalArguments extension

The argument at index as a T, or absent when it is not passed.