-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unoptimal inference when function has error in a implicit return #54029
Comments
Fixed by #49260 I guess |
It turns out that this is because Pkg.jl set I have a potential solution in my mind, but it looks like it won't require merging #49260. |
aviatesk
added a commit
that referenced
this issue
Apr 15, 2024
It is important to always be able to infer the return type of `error` as `Union{}`, but there's a hitch when a package globally sets `@max_methods 1` and it causes inference for `error(::Any)` to fail (#54029). To address this, this commit sets `@max_methods 2 function error end` at the definition of `error`. This overrides any global `@max_methods 1` settings on package side, guaranteeing that return type inference on `error` is successful always.
See #54086. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While investigating some type instabilities in Pkg code specifically
the #21 might not be correct but it's the kwcall done in
code_typed(Core.kwcall, (@NamedTuple{platform::Base.BinaryPlatforms.Platform}, typeof(Pkg.Artifacts.ensure_artifact_installed), String, Dict{String, Any}, String))
this code has a unstable return type because inference isn't able to succeed in realising that a call to
error
always throwsThe text was updated successfully, but these errors were encountered: