M2 icon indicating copy to clipboard operation
M2 copied to clipboard

unhelpful warning message

Open mikestillman opened this issue 3 years ago • 5 comments

I have a package that I am writing, and I get the following behavior when loading it. This package loads a number of other packages too.

i1 : needsPackage "StringTorics"
warning: 'intersectionNumbers' redefined
: here is the first use of 'intersectionNumbers'
       : debug with expression   debug 2671   or with command line option   --debug 2671

This appears to be a bug? I try debug 2671 and get nothing useful either. I'll look into this to try to boil the problem down.

mikestillman avatar Aug 24 '22 13:08 mikestillman

I kept getting a similar error in a different context as well, and calling debug didn't seem to do anything.

mahrud avatar Aug 24 '22 17:08 mahrud

Here is a minimal example:

newPackage "Foo"
f = x -> x
f = x -> x

The warning message is intentional.

DanGrayson avatar Aug 25 '22 12:08 DanGrayson

Maybe it should be made clearer, but calling debug with that number should throw you into the debugger when you run the code again.

DanGrayson avatar Aug 25 '22 12:08 DanGrayson

After I got that error message, I tried what you suggest (call debug with that number), and I now forgot what error message I then got, but it wasn’t useful and didn’t point to the location of the redefinition (or definition).

On Aug 25, 2022, at 8:55 AM, Daniel R. Grayson @.***> wrote:

Maybe it should be made clearer, but calling debug with that number should throw you into the debugger when you run the code again.

— Reply to this email directly, view it on GitHub https://github.com/Macaulay2/M2/issues/2582#issuecomment-1227220179, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAY6R3M6IG2QEXC3O6N5JTV25UKVANCNFSM57PJX6AQ. You are receiving this because you authored the thread.

mikestillman avatar Aug 25 '22 13:08 mikestillman

Maybe try restarting M2 and doing everything the same, except insert "--debug 2671" on the command line.

DanGrayson avatar Aug 25 '22 14:08 DanGrayson