Skip to content

Commit b058146

Browse files
authored
add :import/:using/:export heads to VALID_EXPR_HEADS (#52906)
Typically, top-level thunks that include these exprs aren't compiled. However, in certain `AbstractInterpreter`s such as JET, there's a need to perform inference on arbitrary top-level thunks for analysis purposes. So this commit updates the IR validator so that it does not raise errors on these exprs.
1 parent d479660 commit b058146

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

base/compiler/validation.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ const VALID_EXPR_HEADS = IdDict{Symbol,UnitRange{Int}}(
3434
:throw_undef_if_not => 2:2,
3535
:aliasscope => 0:0,
3636
:popaliasscope => 0:0,
37-
:new_opaque_closure => 4:typemax(Int)
37+
:new_opaque_closure => 4:typemax(Int),
38+
:import => 1:typemax(Int),
39+
:using => 1:typemax(Int),
40+
:export => 1:typemax(Int),
3841
)
3942

4043
# @enum isn't defined yet, otherwise I'd use it for this

0 commit comments

Comments
 (0)