Skip to content

Commit

Permalink
Merge pull request #460 from alex-konovalov/fail-method-arg
Browse files Browse the repository at this point in the history
Extra hint in "No Method Found" if one of the arguments is 'fail'
  • Loading branch information
fingolfin committed Feb 8, 2016
2 parents f00140f + 3109f08 commit 97fa819
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/methsel2.g
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ApplicableMethod := fail;
##
HANDLE_METHOD_NOT_FOUND := function ( INF )
local no_method_found, ShowArguments, ShowArgument, ShowDetails, ShowMethods,
ShowOtherMethods;
ShowOtherMethods, i;


#############################################################################
Expand Down Expand Up @@ -226,6 +226,12 @@ end;
PRINT_TO( "*errout*",
"Error, no method found! For debugging hints type ?Recovery from NoMethodFound\n" ); # should go to errout
no_method_found:="no ";
for i in [ 1 .. LENGTH(INF.Arguments) ] do
if INF.Arguments[i] = fail then
PRINT_TO( "*errout*",
"The ", Ordinal(i), " argument is 'fail' which might point to an earlier problem\n" ); # should go to errout
fi;
od;
APPEND_LIST(no_method_found,Ordinal(INF.Precedence+1));
APPEND_LIST(no_method_found," choice method found for `");
APPEND_LIST(no_method_found,NAME_FUNC(INF.Operation));
Expand Down

0 comments on commit 97fa819

Please sign in to comment.