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

A bug with using M: a as b #42808

Closed
tkf opened this issue Oct 26, 2021 · 1 comment · Fixed by #43291
Closed

A bug with using M: a as b #42808

tkf opened this issue Oct 26, 2021 · 1 comment · Fixed by #43291
Labels
bug Indicates an unexpected problem or unintended behavior modules

Comments

@tkf
Copy link
Member

tkf commented Oct 26, 2021

baremodule M1
    module Inner
        macro dummy end
    end
    using .Inner: @dummy as @sync
    # const var"@sync" = Inner.var"@dummy"  # this works
end

baremodule M2
    using ..M1: @sync
end

using Test
@test M2.var"@sync" === M1.var"@sync"

fails with

  Expression: Demo2.var"@sync" === Demo.var"@sync"
   Evaluated: var"@sync" === Main.Demo.Inner.var"@dummy"
@tkf tkf changed the title A bug with using-as A bug with using M: a as b Oct 27, 2021
@JeffBezanson JeffBezanson added bug Indicates an unexpected problem or unintended behavior modules labels Oct 27, 2021
@Pangoraw
Copy link
Contributor

Seems like it is caused by the same problem as #43290 with a possible fix in #43291

Using #43291, both lhs and rhs resolve to the same binding:

julia> @test M2.var"@sync" === M1.var"@sync"
Test Passed
  Expression: M2.var"@sync" === M1.var"@sync"
   Evaluated: Main.M1.Inner.var"@dummy" === Main.M1.Inner.var"@dummy"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior modules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants