You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ enforces Positional type, % enforces Associative type and & enforces Callable type. However, those type constaints are ignored when deciding which method should be multi dispatched to when having more than one such method.
niecza> multi a(@a) { 'array' }
sub a(@a) { ... }
niecza> multi a(%a) { 'hash' }
sub a(%a) { ... }
niecza> multi a(&a) { 'sub' }
sub a(Any &a) { ... }
niecza> a [1, 2, 3]
array
niecza> a {a => 'b'}
hash
niecza> a {say 42}
sub
niecza> multi a($a) { 'scalar' }
sub a(Any $a) { ... }
niecza> a 'abc'
scalar
niecza> a [1, 2, 3]
scalar
niecza> a {a => 'b'}
scalar
niecza> a {say 42}
scalar
niecza>
The text was updated successfully, but these errors were encountered:
@
enforcesPositional
type,%
enforcesAssociative
type and&
enforcesCallable
type. However, those type constaints are ignored when deciding which method should bemulti
dispatched to when having more than one such method.The text was updated successfully, but these errors were encountered: