ruff/crates/red_knot_python_semantic/resources/mdtest/directives
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
..
assert_never.md [red-knot] Detect version-related syntax errors (#16379) 2025-04-17 14:00:30 -04:00
assert_type.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
cast.md [red-knot] Handle explicit class specialization in type expressions (#17434) 2025-04-18 11:49:22 -04:00