Skip to content

Commit

Permalink
inference: Allow any non-nothing source in ci_has_source for extern o…
Browse files Browse the repository at this point in the history
…wner (#55294)

In updating DAECompiler to the new engine API, I was running some
trouble, because the source it produces is not a `CodeInfo` or a
`String` (which is fine because it has a non-nothing `owner`). Adjust
the test to consider any non-nothing value in .inferred valid source (at
least for non-nothing CI owners).
  • Loading branch information
Keno authored Jul 30, 2024
1 parent e0f2e29 commit 5862301
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/compiler/typeinfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ const SOURCE_MODE_FORCE_SOURCE = 0x2

function ci_has_source(code::CodeInstance)
inf = @atomic :monotonic code.inferred
return isa(inf, CodeInfo) || isa(inf, String)
return code.owner === nothing ? (isa(inf, CodeInfo) || isa(inf, String)) : inf !== nothing
end

"""
Expand Down

0 comments on commit 5862301

Please sign in to comment.