-
-
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
call signature with free type variable can corrupt the dispatch cache #49027
Comments
We use the specialized signature of a method for accurate analysis of whether a static parameter is constrained or not. However, it turns out that we can only use it when it doesn't contain any free type variables (which it sometimes does, e.g., when the inference entry is given a signature with a free type variable). In such cases, we should use the method signature, which, by design, never contains any free type variables. fix #49027
We use the specialized signature of a method for accurate analysis of whether a static parameter is constrained or not. However, it turns out that we can only use it when it doesn't contain any free type variables (which it sometimes does, e.g., when the inference entry is given a signature with a free type variable). In such cases, we should use the method signature, which, by design, never contains any free type variables. fix #49027
Note that this construction will partially corrupt the dispatch cache currently (even after #49097), potentially leading to undefined behavior, so users should avoid defining methods that may get called like that for now. We have a few open issues about eventually fixing that, but it has not been a priority yet. |
I am not sure this exact construction is what is used in practice. It was more something like:
where |
Yes, that is what is not permitted currently. Since |
Removed the |
@isdefined
sometimes returns true even though the variable is undefined
MWE:
On bad Julia versions this gives
On good ones
Bisected to #46791 (which was backported). cc @aviatesk
Xref: #35661
The text was updated successfully, but these errors were encountered: