# New Ticket Created by Zoffix Znet
# Please include the string: [perl #132307]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=132307 >
The following code tries to pass Str `:bin` named arg to a Code that wants an
`Int` `:bin` arg.
The typecheck correctly fails, but only if no positional slurpies are present
in the signature.
<Zoffix__> m: -> Int :$bin {say [$bin, $bin.^name]}(:bin<x>)
<camelia> rakudo-moar ebb0521bd: OUTPUT: «Type check failed in binding to
parameter '$bin'; expected Int but got Str ("x") in block <unit> at <tmp>
line 1»
<Zoffix__> m: -> *@, Int :$bin {say [$bin, $bin.^name]}(:bin<x>)
<camelia> rakudo-moar ebb0521bd: OUTPUT: «[x Str]»
<Zoffix__> m: -> +@, Int :$bin {say [$bin, $bin.^name]}(:bin<x>)
<camelia> rakudo-moar ebb0521bd: OUTPUT: «[x Str]»
<Zoffix__> m: -> **@, Int :$bin {say [$bin, $bin.^name]}(:bin<x>)
<camelia> rakudo-moar ebb0521bd: OUTPUT: «[x Str]»
<Zoffix__> m: -> Int :$bin, *%_ {say [$bin, $bin.^name]}(:bin<x>)
<camelia> rakudo-moar ebb0521bd: OUTPUT: «Type check failed in binding to
parameter '$bin'; expected Int but got Str ("x") in block <unit> at <tmp>
line 1»
<Zoffix__> m: -> Int :$bin, | {say [$bin, $bin.^name]}(:bin<x>)
<camelia> rakudo-moar ebb0521bd: OUTPUT: «Type check failed in binding to
parameter '$bin'; expected Int but got Str ("x") in block <unit> at <tmp>
line 1»
NOTE: fixing this will likely have some fallout to watch out for, including
test breakage in core (e.g., as I write this, accessing $*ARGFILES would've been
crashing, as its instantiated with an Int for `:bin` instead of a Bool)