You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARNING: replacing module dat.
WARNING: using dat.Visible in module Main conflicts with an existing identifier.
WARNING: both dat and dat export "Invisible"; uses of it in module Main must be qualified
ERROR: LoadError: UndefVarError: Invisible not defined
Stacktrace:
[1] top-level scope
@ main.jl:5
in expression starting at main.jl:5
If the line const var = Visible(10) is well hidden inside mountains of code, you can look at it for a loooong time without finding the bug. Other than const var = Visible(10) the types Visible and Invisible are defined in the same way at the same point, yet one is visible and the other one is not.
It is especially confusing because something like const var = Visible(10) does not affect the visibility of a type in most other languages.
I encountered this is a real world application and I only found it by
deleting some code
Check if the same error message still appears. If no, un-delete this code
Repeat step 1 until you have 20 lines of code that reproduce the error message.
I don't know julia well enough to know how this can be made easier to debug. Hopefully you know.
The text was updated successfully, but these errors were encountered:
I'm am not quite sure what you are suggesting to fix, since it output numerous warnings for when it ran into errors with your code. Perhaps we could print more context there, like the backtrace?
vtjnash
changed the title
language design leads to some very hard to debug problems
replacing a module leads to confusing errors
Sep 3, 2021
Let's say
other.jl
looks something like thisAnd you accidentally include this file twice (directly or indirectly):
Executing this will output
If the line
const var = Visible(10)
is well hidden inside mountains of code, you can look at it for a loooong time without finding the bug. Other thanconst var = Visible(10)
the typesVisible
andInvisible
are defined in the same way at the same point, yet one is visible and the other one is not.It is especially confusing because something like
const var = Visible(10)
does not affect the visibility of a type in most other languages.I encountered this is a real world application and I only found it by
I don't know julia well enough to know how this can be made easier to debug. Hopefully you know.
The text was updated successfully, but these errors were encountered: