-
-
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
Method lookup with Tuple{DataType,Any}
regression
#23024
Comments
Seems the method lookup didn't regress (0.6 also return empty lookup result) but now type inference is exploiding that.... |
Looks like this case is wrong:
|
@JeffBezanson Why does this filter code exist? I don't see any tests fail if I remove it (although I only tested it on my branch where I also have #21026 fixed): diff --git a/src/subtype.c b/src/subtype.c
index ac6bc07c01..95d91d8b4c 100644
--- a/src/subtype.c
+++ b/src/subtype.c
@@ -2142,20 +2142,9 @@ jl_value_t *jl_type_intersection_env_s(jl_value_t *a, jl_value_t *b, jl_svec_t *
else {
sz = szb;
// TODO: compute better `env` directly during intersection.
- // we assume that if the intersection is a leaf type, we have
- // full information in `env`. however the intersection algorithm
- // does not yet provide that in all cases so use subtype.
+ // for now, we attempt to compute env by using subtype on the intersection result
if (szb > 0 && !jl_types_equal(b, (jl_value_t*)jl_type_type)) {
- if (jl_subtype_env(*ans, b, env, szb)) {
- if (jl_is_leaf_type(*ans)) {
- for(i=0; i < sz; i++) {
- if (jl_is_typevar(env[i])) {
- *ans = jl_bottom_type; goto bot;
- }
- }
- }
- }
- else {
+ if (!jl_subtype_env(*ans, b, env, szb)) {
sz = 0;
}
} |
If anything, it would probably be an inference precision issue, where it's harder to get failures. It also might only be needed because of #21026. |
fix #23024 and improve subtype test macro to always check for this
fix #23024 and improve subtype test macro to always check for this
Reduced from OpenCL.jl test failure.
Output:
Doesn't happen on 0.6.
The text was updated successfully, but these errors were encountered: