You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inscrutable Box<dyn Any> error message indicates a Salsa query cycle. In this case it would be due to calling infer_scope_types in type narrowing, when in turn type narrowing may well have been called by infer_scope_types on that same scope.
For expressions that function as narrowing predicates, we will usually need to add them as standalone expressions when building the semantic index, so we can query their type independently. Though since match patterns don't use Expr but rather ComparableExpr, this will probably require adding some new infrastructure for standalone ComparableExpr.
(Note this task is assigned to me, it's not up-for-grabs at the moment.)
Just a quick note that I touched some of the relevant code in #14759. So maybe contact me before starting with this task (in case #14759 has not been merged in the meantime).
The goal of this issue is to make this mdtest pass:
This should just require filling in the TODO for
MatchClass
atruff/crates/red_knot_python_semantic/src/types/narrow.rs
Line 232 in 83651de
We don't need to worry about arguments yet; the goal here is just to narrow based on the implicit
isinstance
check performed by the class pattern.See https://docs.python.org/3/reference/compound_stmts.html#class-patterns for the documentation of the language feature.
The text was updated successfully, but these errors were encountered: