-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
type aliases no longer work? #116
Comments
Thanks for the report... It looks like this was caused by 6ce212a. That prevents code like:
From crashing, but we'll need to come up with a better solution here and retain the implicit type information while disallowing the conflicting assignment. We do report the invalid assignment if |
We've come up with some other interesting examples:
And we've looked at what Pyre does here as well. Both Pyre and static Python have a notion of inferred type as well as the declared type. In some annotated cases like "x = 42" it seems that there ends up being an inferred type of Currently we only end up with an inferred type, and then we're turning that into dynamic. We probably need to more closely mimic what Pyre is doing for getting a declared type in these situations, and then drop the inferred type. And we need to understand more when we should treat the inferred type as declared. We also may be able to do this in limited scenarios, e.g. where there are no references to And we may need to add an extra pass in to accomodate this as well. Unfortunately this will take a little while to get to! |
On cinder/3.10,
fannkuch_static_lib.py
andnqueens_static_lib.py
give errors like this:The array count is defined using a type alias:
Changing the definition to use the type directly removes the error:
That's surprising! Did something break with type aliases?
cc @vivaan2006 who helped discover this
The text was updated successfully, but these errors were encountered: