Skip to content

Multiline comment parsing error on 1.11-rc3 #55792

Closed
@j-fu

Description

@j-fu

When loaded via using from a directory on LOAD_PATH, the following code
works on Julia 1.10.5, but fails on 1.11-rc3 as well on nightly (02549d5):

#=
Demonstrate a parsing error when 
using multiline comments on Julia 1.11-rc3
^^^^^
   This `using` word makes 1.11-rc3 believe that 
there is a `using` statement before the module
declaration when the code is loaded from a directory
on LOAD_PATH
=#
module UsingError
main()=println("Hi there!")
end

This is the error message:

julia> using UsingError
[ Info: Precompiling UsingError [top-level]
ERROR: LoadError: Package UsingError [top-level] source file /home/fuhrmann/Wias/work/julia/dev/VoronoiFVM/examples/UsingError.jl has a using/import before a module declaration.
Stacktrace:
[1] check_src_module_wrap(pkg::Base.PkgId, srcpath::String)
@ Base ./loading.jl:2718
[2] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
@ Base ./loading.jl:2733
[3] top-level scope
@ stdin:4
in expression starting at stdin:4
ERROR: Failed to precompile UsingError [top-level] to "/home/fuhrmann/.julia/compiled/v1.11/jl_RH516U".
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{…})
@ Base ./loading.jl:3036
[3] (::Base.var"#1080#1081"{Base.PkgId})()
...

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