Skip to content

Commit fcfa4ed

Browse files
committed
Fix @isdefined for globals
K"globalref" doesn't exist until later
1 parent 982199f commit fcfa4ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/closure_conversion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ function _convert_closures(ctx::ClosureConversionCtx, ex)
338338
elseif binfo.is_always_defined || is_self_captured(ctx, var)
339339
# Captured but unboxed vars are always defined
340340
@ast ctx ex true::K"Bool"
341-
elseif kind(var) == K"globalref"
341+
elseif binfo.kind == :global
342342
# Normal isdefined won't work for globals (#56985)
343343
@ast ctx ex [K"call"
344344
"isdefinedglobal"::K"core"

0 commit comments

Comments
 (0)