Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -5090,6 +5090,7 @@ f(x) = yt(x)
(check-top-level e)
(let ((val (make-ssavalue)))
(emit `(= ,val ,e))
(emit `(latestworld))
(if tail (emit-return tail val))
val))

Expand Down
18 changes: 18 additions & 0 deletions test/worlds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -598,3 +598,21 @@ function f()
end
end
@test_throws ErrorException("importing Random into M57965 conflicts with an existing global") M57965.f()

# issue #59429 - world age semantics with toplevel in macros
module M59429
using Test
macro new_enum(T::Symbol, args...)
esc(quote
@enum $T $(args...)
function Base.hash(x::$T, h::UInt)
rand(UInt)
end
end)
end

@new_enum Foo59429 bar59429 baz59429

# Test that the hash function works without world age issues
@test hash(bar59429, UInt(0)) isa UInt
end