Skip to content

Importing a module and a submodule in the same statement fails in 1.12 #57316

@christiangnrd

Description

@christiangnrd

MWE:
imp.jl:

module A
    export B
    module B
        export foo
        function foo()
            println("Hello, world!")
        end
    end
end

1.11.3:

X:~/.julia/dev/ObjectiveC$ j --banner=short
  o  | Version 1.11.3 (2025-01-21)
 o o | Official https://julialang.org/ release
julia> include("imp.jl"); using .A, .B

julia> foo()
Hello, world!

master:

X:~/.julia/dev/ObjectiveC$ j +nightly --banner=short
  o  | Version 1.13.0-DEV.23 (2025-02-08)
 o o | Commit dbd52802516 (0 days old master)
julia> include("imp.jl"); using .A, .B
ERROR: UndefVarError: `B` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] top-level scope
   @ REPL[1]:1

In JuliaInterop/ObjectiveC.jl#52, the error even suggests that .Foundation exists as a constant of ObjectiveC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    modulesregressionRegression in behavior compared to a previous versionregression 1.12Regression in the 1.12 release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions