suffix
ErrorsCollection

suffix

Synthesised documentation from type/Parameter

From type/Parameter

See Original text in context

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: «␤»