Skip to content

It is now possible to create globals in a different module #54607

Closed
@LilithHafner

Description

@LilithHafner
x@fedora:~$ julia +1.8 -q
julia> module M; end
Main.M

julia> M.x = 6
ERROR: cannot assign variables in other modules
Stacktrace:
 [1] setproperty!(x::Module, f::Symbol, v::Int64)
   @ Base ./Base.jl:32
 [2] top-level scope
   @ REPL[2]:1

julia> 
x@fedora:~$ julia +1.9 -q
julia> module M; end
Main.M

julia> M.x = 6
6

From the discussion at #44231, this seems unintentional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    minor changeMarginal behavior change acceptable for a minor release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions