-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Labels
compiler:effectseffect analysiseffect analysiscompiler:loweringSyntax lowering (compiler front end, 2nd stage)Syntax lowering (compiler front end, 2nd stage)priorityThis should be addressed urgentlyThis should be addressed urgently
Milestone
Description
MWE:
let
global set_a, get_a
_a::Int = -1
set_a(a::Int) = (_a = a; return get_a())
get_a() = _a
end
set_a(1)
get_a()
set_a(2)
get_a()
Wrong output in Julia 1.10:
julia> let
global set_a, get_a
_a::Int = -1
set_a(a::Int) = (_a = a; return get_a())
get_a() = _a
end
get_a (generic function with 1 method)
julia> set_a(1)
-1
julia> get_a()
-1
julia> set_a(2)
-1
julia> get_a()
-1
Correct output in Julia 1.9.4:
julia> let
global set_a, get_a
_a::Int = -1
set_a(a::Int) = (_a = a; return get_a())
get_a() = _a
end
get_a (generic function with 1 method)
julia> set_a(1)
1
julia> get_a()
1
julia> set_a(2)
2
julia> get_a()
2
luraess
Metadata
Metadata
Labels
compiler:effectseffect analysiseffect analysiscompiler:loweringSyntax lowering (compiler front end, 2nd stage)Syntax lowering (compiler front end, 2nd stage)priorityThis should be addressed urgentlyThis should be addressed urgently