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

"no method found" points to the wrong line of code #616

Closed
ssiccha opened this issue Feb 15, 2016 · 4 comments · Fixed by #2520
Closed

"no method found" points to the wrong line of code #616

ssiccha opened this issue Feb 15, 2016 · 4 comments · Fixed by #2520
Assignees
Labels
kind: bug Issues describing general bugs, and PRs fixing them topic: error handling

Comments

@ssiccha
Copy link
Contributor

ssiccha commented Feb 15, 2016

When I run

f := function() 
  local l;
  l := 0 * [1..6];
  l[[1..3]] := 1;
end;
f();

I get the error msg

Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `[]:=' on 3 arguments called from
0 * [ 1 .. 6 ] at stream:3 called from
<function "f">( <arguments> )
 called from read-eval loop at line 5 of stream
...

although l[[1..3]] := 1; is the offending part of code.
This does not happen with my version of GAP 4.7.9.

@ChrisJefferson
Copy link
Contributor

This has actually also got worse in the GAP 4.8 betas. I will investigate.

@ChrisJefferson
Copy link
Contributor

Further investigation (for my own records mainly). The problem is that this used to be invalid because you can only index lists with integers. Now it's invalid because we can index lists with anything, but l in particular doesn't do indexing by a range, so the underlying error was always there (wrong marking of place where error occurs), but it didn't show up before.

@olexandr-konovalov olexandr-konovalov added the topic: HPC-GAP Issues and PRs related to HPC-GAP label Feb 28, 2016
@fingolfin fingolfin added the kind: bug Issues describing general bugs, and PRs fixing them label May 9, 2017
@fingolfin fingolfin removed the topic: HPC-GAP Issues and PRs related to HPC-GAP label Aug 28, 2017
@fingolfin fingolfin changed the title HPCGAP's "no method found" points to the wrong line of code "no method found" points to the wrong line of code Aug 28, 2017
@fingolfin
Copy link
Member

This problem also occurs in plain GAP.

@fingolfin
Copy link
Member

For some background: this is because we don't call SET_BRK_CALL_TO enough. I do have a fix for that ready; the main thing missing is a collection of tests which verify this doesn't break other things, and also ensuring this doesn't regress.
I.e. I want a bunch of tests which record the reported error, in different scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Issues describing general bugs, and PRs fixing them topic: error handling
Projects
None yet
4 participants