ruff/crates/red_knot_python_semantic/resources/mdtest/assignment
Douglas Creager 787bcd1c6a
[red-knot] Handle explicit class specialization in type expressions (#17434)
You can now use subscript expressions in a type expression to explicitly
specialize generic classes, just like you could already do in value
expressions.

This still does not implement bidirectional checking, so a type
annotation on an assignment does not influence how we infer a
specialization for a (not explicitly specialized) constructor call. You
might get an `invalid-assignment` error if (a) we cannot infer a class
specialization from the constructor call (in which case you end up e.g.
trying to assign `C[Unknown]` to `C[int]`) or if (b) we can infer a
specialization, but it doesn't match the annotation.

Closes https://github.com/astral-sh/ruff/issues/17432
2025-04-18 11:49:22 -04:00
..
annotations.md [red-knot] Handle explicit class specialization in type expressions (#17434) 2025-04-18 11:49:22 -04:00
augmented.md [red-knot] Use try_call_dunder for augmented assignment (#16717) 2025-03-14 20:36:09 +01:00
multi_target.md [red-knot] Port type inference tests to new test framework (#13719) 2024-10-15 11:23:46 -07:00
unbound.md Migrate some inference tests to mdtests (#14795) 2024-12-06 11:19:22 +01:00
walrus.md [red-knot] Port type inference tests to new test framework (#13719) 2024-10-15 11:23:46 -07:00