Conversation
ceb5916 to
f56e867
Compare
carljm
left a comment
There was a problem hiding this comment.
Happy to do a VC call next week if anything remains unclear about how this is all supposed to work!
9f827d6 to
b9d931c
Compare
|
e8c92e3 to
06e615d
Compare
carljm
left a comment
There was a problem hiding this comment.
The updated type inference structure looks great!
| // fails with salsa cycle panic: | ||
| ("crates/ruff_python_parser/resources/inline/err/type_alias_invalid_value_expr.py", true, true), |
There was a problem hiding this comment.
This is interesting. I suspect it might go away if we stop trying to infer the type of .value() on a type alias anytime we encounter it. If not I'll want to take a closer look.
There was a problem hiding this comment.
It happens for self-referential type aliases like type NestedInt = int | list[NestedInt]. We form a genuine cycle when inferring the annotation type on the RHS and look up the name NestedInt.
06e615d to
2a7070d
Compare
Summary
Add support for (non-generic) type aliases. The main motivation behind this was to get rid of panics involving expressions in (generic) type aliases. But it turned out the best way to fix it was to implement (partial) support for type aliases.
Test Plan
type_alias.md)