Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
christiangnrd opened this issue Feb 8, 2025 · 0 comments
Open
Labels
modules regression Regression in behavior compared to a previous version regression 1.12 Regression in the 1.12 release
Milestone

Comments

@christiangnrd
Copy link
Contributor

christiangnrd commented Feb 8, 2025

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.

@christiangnrd christiangnrd changed the title Importing a module and a submodule from the same statement fails in 1.12 Importing a module and a submodule in the same statement fails in 1.12 Feb 9, 2025
@nsajko nsajko added the modules label Feb 9, 2025
@KristofferC KristofferC added this to the 1.12 milestone Feb 9, 2025
@ararslan ararslan added regression Regression in behavior compared to a previous version regression 1.12 Regression in the 1.12 release labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules regression Regression in behavior compared to a previous version regression 1.12 Regression in the 1.12 release
Projects
None yet
Development

No branches or pull requests

4 participants