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 when no multi method candidate can be invoked #1856
Comments
From @moritz12:11 <@moritz_> rakudo: class A { multi method b($x where { 0 } ) { } It should mention at least: bonus points (and a beer at our next meeting) for listing candidates |
From @jnthnOn Sat Jun 19 03:15:52 2010, moritz wrote:
So, taking a more interesting example: class A { Running this now gives the far, far more informative: No candidates found to invoke for method 'b' on object of type 'A'; Good enough for beer? ;-) Given to moritz++ in case this is something that is testable or should Jonathan |
The RT System itself - Status changed from 'new' to 'open' |
@moritz - Status changed from 'open' to 'resolved' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S12-methods/multi.t commit 4b312a5186e94c35751ac9e57bd520cd5869ad49 [t/spec] tests for RT #75872, awesome error message when multi method dispatch finds no matching candidate Inline Patchdiff --git a/t/spec/S12-methods/multi.t b/t/spec/S12-methods/multi.t
index 08e753f..5710b21 100644
--- a/t/spec/S12-methods/multi.t
+++ b/t/spec/S12-methods/multi.t
@@ -194,6 +194,16 @@ is Bar.new.a("not an Int"), 'Any-method in Foo';
is WorkingTie.has_tie( 42 ), 'tie3', 'broken class fixed by subclass (1)';
is WorkingTie.has_tie( 'x' ), 'tie4', 'broken class fixed by subclass (2)';
+
+ my $error;
+ try {
+ WorkingTie.new.has_tie([]);
+ }
+ $error = "$!";
+ ok $error ~~ /<< 'has_tie' >>/,
+ 'error message for failed dispatch contains method name';
+ ok $error ~~ /<< 'WorkingTie' >>/,
+ 'error message for failed dispatch contains invocant type';
}
done_testing; |
Migrated from rt.perl.org#75872 (status was 'resolved')
Searchable as RT75872$
The text was updated successfully, but these errors were encountered: