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

LTA error message for multi-dispatch failures could use the capture on which binding failed in Rakudo #2235

Closed
p6rt opened this issue Oct 28, 2010 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 28, 2010

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

Searchable as RT78670$

@p6rt
Copy link
Author

p6rt commented Oct 28, 2010

From @masak

<PerlJam> It would be nice if multi-dispatch errors has a little more
awesomeness.
<PerlJam> It lists the candidates' signatures, but not what it's
trying to match against those signatures.
<masak> indeed. I've had the same thought.
<PerlJam> jnthn​: How hard would it be to add the capture of the
sub/method being matched against candidates in multi-dispatch when it
fails?
<jnthn> We could. (more)
<jnthn> I'm just a little scared what happens if that evaluation goes explodey.
<jnthn> For <handwaving> reasons, it may be tricky to be robust in that case.
<jnthn> We could easily try it though.
<masak> \o/
<jnthn> oh, akshually, I can think of an OK way to do it.
<jnthn> Best is to file a ticket suggesting it.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Mar 4, 2015

From @Mouq

02​:23 < Mouq> There aren't any specific examples given for #​78670... can we consider it closable with tests?
02​:23 < synopsebot> Link​: https://rt-archive.perl.org/perl6//Public/Bug/Display.html?id=78670
02​:24 < Mouq> m​: multi foo(Int $x, Str $b) {}; my $a = "bcd"; foo $a
02​:24 <+camelia> rakudo-moar 070196​: OUTPUT«===SORRY!=== Error while compiling /tmp/sguTFCxzau␤Calling 'foo' will never work with argument types (Mu)␤
  Expected any of​: ␤ :(Int $x, Str $b)␤at /tmp/sguTFCxzau​:1␤------> foo(Int $x, Str $b) {}; my $a = "bcd"; ⏏foo $a␤»
02​:25 < Mouq> m​: multi foo(Int $x, Str $b) {}; my $a = "bcd"; foo $a, "bar"
02​:25 <+camelia> rakudo-moar 070196​: OUTPUT«Cannot call 'foo'; none of these signatures match​:␤​:(Int $x, Str $b)␤ in sub foo at /tmp/S66ShGWzau​:1␤ in block
  <unit> at /tmp/S66ShGWzau​:1␤␤»
02​:25 < Mouq> Ahh, it just seems to be errors the compiler can catch early
02​:25 < Mouq> I'll add this to the ticket

To clarify, the first example has a good error. The second doesn't include information about why it failed to find a matching signature, and thus is still LTA.

On Thu Oct 28 09​:36​:37 2010, masak wrote​:

<PerlJam> It would be nice if multi-dispatch errors has a little more
awesomeness.
<PerlJam> It lists the candidates' signatures, but not what it's
trying to match against those signatures.
<masak> indeed. I've had the same thought.
<PerlJam> jnthn​: How hard would it be to add the capture of the
sub/method being matched against candidates in multi-dispatch when it
fails?
<jnthn> We could. (more)
<jnthn> I'm just a little scared what happens if that evaluation goes
explodey.
<jnthn> For <handwaving> reasons, it may be tricky to be robust in
that case.
<jnthn> We could easily try it though.
<masak> \o/
<jnthn> oh, akshually, I can think of an OK way to do it.
<jnthn> Best is to file a ticket suggesting it.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Mar 4, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 21, 2015

From @Mouq

On Tue Mar 03 18​:27​:45 2015, Mouq wrote​:

02​:23 < Mouq> There aren't any specific examples given for #​78670...
can we consider it closable with tests?
02​:23 < synopsebot> Link​:
https://rt-archive.perl.org/perl6//Public/Bug/Display.html?id=78670
02​:24 < Mouq> m​: multi foo(Int $x, Str $b) {}; my $a = "bcd"; foo $a
02​:24 <+camelia> rakudo-moar 070196​: OUTPUT«===SORRY!=== Error while
compiling /tmp/sguTFCxzau␤Calling 'foo' will never work with argument
types (Mu)␤
Expected any of​: ␤ :(Int $x, Str $b)␤at
/tmp/sguTFCxzau​:1␤------> foo(Int $x, Str $b) {}; my $a = "bcd"; ⏏foo
$a␤»
02​:25 < Mouq> m​: multi foo(Int $x, Str $b) {}; my $a = "bcd"; foo $a,
"bar"
02​:25 <+camelia> rakudo-moar 070196​: OUTPUT«Cannot call 'foo'; none of
these signatures match​:␤​:(Int $x, Str $b)␤ in sub foo at
/tmp/S66ShGWzau​:1␤ in block
<unit> at /tmp/S66ShGWzau​:1␤␤»
02​:25 < Mouq> Ahh, it just seems to be errors the compiler can catch
early
02​:25 < Mouq> I'll add this to the ticket

Current behavior​:

06​:41 <Mouq> m​: multi foo(Int $x, Str $b) {}; my $a = "bcd"; foo $a
06​:41 <camelia> rakudo-moar dfad9c​: OUTPUT«===SORRY!=== Error while compiling /tmp/77JmpQrCM7␤Calling foo(Mu) will never work with any of
  these multi signatures​:␤ (Int $x, Str $b)␤at /tmp/77JmpQrCM7​:1␤------> foo(Int $x, Str $b) {}; my $a = "bcd"; ⏏foo $a␤»
06​:41 <Mouq> m​: multi foo(Int $x, Str $b) {}; my $a = "bcd"; foo $a, "bar"
06​:41 <camelia> rakudo-moar dfad9c​: OUTPUT«Cannot call foo(Str, Str); none of these signatures match​:␤ (Int $x, Str $b)␤ in sub foo at
  /tmp/e5lT9TVHuv​:1␤ in block <unit> at /tmp/e5lT9TVHuv​:1␤␤»

A test was added in Roast commit d4b9bb80940d8.

Closing this ticket as resolved :)

~Mouq

@p6rt
Copy link
Author

p6rt commented Mar 21, 2015

@Mouq - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Mar 21, 2015
@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