Skip to content

Commit

Permalink
Assert that _artifact_str returns a String (#38975)
Browse files Browse the repository at this point in the history
I have no idea whether this is important, but I noticed this while investigating triggers for inference in a package. Feel free to close if you think this is irrelevant.

Incidentally, `_artifact_str` is a ~60ms precompile (that's just the inference, not the codegen). I see that its precompile was commented out in 924484f; just mentioning it in case there's an opportunity to squeeze out a bit more latency-reduction.

(cherry picked from commit ccaaf56)
  • Loading branch information
timholy authored and staticfloat committed Dec 22, 2022
1 parent c4298e1 commit 327f632
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/Artifacts/src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ macro artifact_str(name, platform=nothing)
platform = HostPlatform()
artifact_name, artifact_path_tail, hash = artifact_slash_lookup(name, artifact_dict, artifacts_toml, platform)
return quote
Base.invokelatest(_artifact_str, $(__module__), $(artifacts_toml), $(artifact_name), $(artifact_path_tail), $(artifact_dict), $(hash), $(platform), $(lazyartifacts))
Base.invokelatest(_artifact_str, $(__module__), $(artifacts_toml), $(artifact_name), $(artifact_path_tail), $(artifact_dict), $(hash), $(platform), $(lazyartifacts))::String
end
else
if platform === nothing
Expand All @@ -680,7 +680,7 @@ macro artifact_str(name, platform=nothing)
return quote
local platform = $(esc(platform))
local artifact_name, artifact_path_tail, hash = artifact_slash_lookup($(esc(name)), $(artifact_dict), $(artifacts_toml), platform)
Base.invokelatest(_artifact_str, $(__module__), $(artifacts_toml), artifact_name, artifact_path_tail, $(artifact_dict), hash, platform, $(lazyartifacts))
Base.invokelatest(_artifact_str, $(__module__), $(artifacts_toml), artifact_name, artifact_path_tail, $(artifact_dict), hash, platform, $(lazyartifacts))::String
end
end
end
Expand Down

0 comments on commit 327f632

Please sign in to comment.