-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Analyzer function type parameters are not correctly scoped #30379
Comments
this might be related: #30375 |
working through the types: f1 is The fact that f2 has the problems is scary... f2 and f3 should be identical. We did have a capture bug here: #29778 (comment) ... any time we create a synthetic function type we hit major problems with substitutions. That could be related. Another problem that scared me recently when reading the code, is whether our "fresh" type variables are actually treated as non-equal to existing type variables or to other "fresh" type variables that have the same name. I worried that synthetic type variables might be falling back to name-based equality. (analyzer uses name-based equality for elements, where the name is "fully-qualified". but I don't know if this can distinguish type variables declared in the same scope, like each |
@leafpetersen I can help look into this if you have not started already |
All yours if you want it, though not sure it's top priority. Just getting a test written to be sure that the new front end does the right thing might be a good start. |
This is now fixed. In the example, there are errors reported on lines 9, 10, 11, and 13:
|
In the following,
G
andH
are entirely equivalent, and neither of them are subtype related toF<T>
for non-trivialT
, butF<T>
andG
(but notH
) are considered assignable.The text was updated successfully, but these errors were encountered: