julia icon indicating copy to clipboard operation
julia copied to clipboard

"WARNING: replacing module..." is no longer printed when replacing modules

Open topolarity opened this issue 9 months ago • 3 comments

Not sure if this is intended as part of binding replacement or not, but wanted to open an issue just in case.

On nightly:

julia> module Foo; end
Main.Foo

julia> module Foo; end
Main.Foo

On 1.11:

julia> module Foo; end
Main.Foo

julia> module Foo; end
WARNING: replacing module Foo.
Main.Foo

topolarity avatar Mar 17 '25 23:03 topolarity

I removed the warning intentionally. This was UB before, so the warning was appropriate. Now this is just a special case of constant redefinition, which we never warn for.

Keno avatar Mar 18 '25 08:03 Keno

That said, we should probably extend the world age printing to the module case as well:

julia> module Foo; end
Main.Foo

julia> oldFoo = Foo
Main.Foo

julia> module Foo; end
Main.Foo

julia> oldFoo
Main.Foo

Keno avatar Mar 18 '25 08:03 Keno

is this also intended?

julia> x = 1
1

julia> module Foo
           export x
           x = 2
       end
Main.Foo

julia> using .Foo

julia> x
1

previously would give WARNING: using Foo.x in module Main conflicts with an existing identifier.

adienes avatar Jun 08 '25 13:06 adienes