Skip to content

include not defined #216

@JeffBezanson

Description

@JeffBezanson

If I pass a file that calls include at the top level, I get an error that include is not defined. For example

a.jl:

include("b.jl")

b.jl:

julia_main() = println("hello")

I believe this is because PackageCompiler evaluates the code in an empty anonymous module. These definitions should be added to the module to make it behave like a normal module (alternatively we could use something like m = module anon end):

eval(x) = Core.eval(@__MODULE__, x)
include(x) = Base.include(@__MODULE__, x)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions