Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X::Multi::NoMatch claims positional args were used when named were #5723

Closed
p6rt opened this issue Oct 3, 2016 · 3 comments
Closed

X::Multi::NoMatch claims positional args were used when named were #5723

p6rt opened this issue Oct 3, 2016 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 3, 2016

Migrated from rt.perl.org#129800 (status was 'resolved')

Searchable as RT129800$

@p6rt
Copy link
Author

p6rt commented Oct 3, 2016

From @zoffixznet

# I have the fix; filing for records

The error message displayed claims I called the method with two
positonal arguments, rather than one positional and one named​:
<ZoffixW> m​: class Z { multi method meow {} }.meow​: 42, :foo(42)
<camelia> rakudo-moar 6c0732​: OUTPUT«Cannot resolve caller meow(Z​:
Int, Int); none of these signatures match​:␤ (Z $​: *%_)␤ in block
<unit> at <tmp> line 1␤␤»
<ZoffixW> m​: class Z { multi method meow {} }.meow​: 42, :foo(Str)
<camelia> rakudo-moar 6c0732​: OUTPUT«Cannot resolve caller meow(Z​:
Int, Str); none of these signatures match​:␤ (Z $​: *%_)␤ in block
<unit> at <tmp> line 1␤␤»

Works fine for Bools
<ZoffixW> m​: class Z { multi method meow {} }.meow​: 42, :foo
<camelia> rakudo-moar 6c0732​: OUTPUT«Cannot resolve caller meow(Z​:
Int, :foo); none of these signatures match​:␤ (Z $​: *%_)␤ in block
<unit> at <tmp> line 1␤␤»

The issue is the string that's supposed to be showing proper named[^1]
has an interpolation
bug where it thinks we're trying to call the .key, which is Str and
that fails. BUT, the whole thing
is wrapped in a `try` so the failure is silent and we get into the
fallback that only gives us the type name. BUT,
that fallback also has a bugglet in that the `​:` to indicate it's a
named param is missing.

[1]
https://github.com/rakudo/rakudo/blob/1e6c465ce27b457b66c1e92d11c23189cb2c451a/src/core/Exception.pm#L2305

@p6rt
Copy link
Author

p6rt commented Oct 3, 2016

From @zoffixznet

Fixed in rakudo/rakudo@f4bda356fc
Tests in Raku/roast@000b930c61

On Mon Oct 03 11​:26​:48 2016, cpan@​zoffix.com wrote​:

# I have the fix; filing for records

The error message displayed claims I called the method with two
positonal arguments, rather than one positional and one named​:
<ZoffixW> m​: class Z { multi method meow {} }.meow​: 42, :foo(42)
<camelia> rakudo-moar 6c0732​: OUTPUT«Cannot resolve caller meow(Z​:
Int, Int); none of these signatures match​:␤ (Z $​: *%_)␤ in block
<unit> at <tmp> line 1␤␤»
<ZoffixW> m​: class Z { multi method meow {} }.meow​: 42, :foo(Str)
<camelia> rakudo-moar 6c0732​: OUTPUT«Cannot resolve caller meow(Z​:
Int, Str); none of these signatures match​:␤ (Z $​: *%_)␤ in block
<unit> at <tmp> line 1␤␤»

Works fine for Bools
<ZoffixW> m​: class Z { multi method meow {} }.meow​: 42, :foo
<camelia> rakudo-moar 6c0732​: OUTPUT«Cannot resolve caller meow(Z​:
Int, :foo); none of these signatures match​:␤ (Z $​: *%_)␤ in
block
<unit> at <tmp> line 1␤␤»

The issue is the string that's supposed to be showing proper named[^1]
has an interpolation
bug where it thinks we're trying to call the .key, which is Str and
that fails. BUT, the whole thing
is wrapped in a `try` so the failure is silent and we get into the
fallback that only gives us the type name. BUT,
that fallback also has a bugglet in that the `​:` to indicate it's a
named param is missing.

[1]
https://github.com/rakudo/rakudo/blob/1e6c465ce27b457b66c1e92d11c23189cb2c451a/src/core/Exception.pm#L2305

@p6rt p6rt closed this as completed Oct 3, 2016
@p6rt
Copy link
Author

p6rt commented Oct 3, 2016

@zoffixznet - Status changed from 'new' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant