positionalOrKeyword(_:annotation:default:)¶
Creates a signature with a positional-or-keyword parameter.
Declaration
static func positionalOrKeyword(
_ name: String,
annotation: (
any Parsable
)? = nil,
default: (
any Parsable
)? = nil
) -> Signature
Parameters
name: The name of the parameter.
annotation: The annotation of the parameter.
default: The default value of the parameter.
Returns
A new signature with the positional-or-keyword parameter.