method suffix

Documentation for method suffix assembled from the following types:

class Parameter

From Parameter

(Parameter) method suffix

Defined as:

method suffix(Parameter:D: --> Str:D)

Returns the ? or ! marker a parameter was declared with, if any. Otherwise, returns the empty string.

my Signature $pos-sig = :($a, $b?);
say $pos-sig.params[0].suffix; # OUTPUT: «""␤»
say $pos-sig.params[1].suffix; # OUTPUT: «?␤»

my Signature $named-sig = :(:$a!, :$b);
say $named-sig.params[0].suffix; # OUTPUT: «!␤»
say $named-sig.params[1].suffix; # OUTPUT: «""␤»