I’m having trouble with functions seemingly disappearing as I get an UndefVarError
.
Specifically, in my case, the subtypes()
function, although I think I encountered the same issue with DataFrames.valuecols()
.
I have no idea what’s going on.
If I run the below in the REPL, it works fine as expected:
using DataFrames
@info subtypes(DataFrame)
# [ Info: Type[]
function get_subtypes()
return subtypes(DataFrame)
end
@info get_subtypes()
# [ Info: Type[]
If I put it into a file and include it, both calls works as expected
julia> include("src/subtypes.jl")
[ Info: Type[]
[ Info: Type[]
But running the file directly doesn’t work:
$ julia --project=. src/subtypes.jl
┌ Error: Exception while generating log record in module Main at c:\programs\ownCloud\projects\example_error\src\subtypes.jl:3
│ exception =
│ UndefVarError: subtypes not defined
│ Stacktrace:
│ [1] top-level scope at logging.jl:331
│ [2] include(::Function, ::Module, ::String) at .\Base.jl:380
│ [3] include(::Module, ::String) at .\Base.jl:368
│ [4] exec_options(::Base.JLOptions) at .\client.jl:296
│ [5] _start() at .\client.jl:506
And in running the actual piece of code I am working on, a call to subtypes()
at the top level works, but the second call within a function errors out with no message:
[ Info: Type[]
ERROR:
This is happening on Windows 10, for both v1.5.0 and v1.4.0
EDIT: Experiencing same issue on Linux, Julia 1.5.0
Does anyone know what’s happening here?
I swear this was working a few weeks ago (I’m working with Julia on and off)