diff --git a/crates/red_knot_python_semantic/src/types/infer.rs b/crates/red_knot_python_semantic/src/types/infer.rs index 676e520564..b0de7ca5c4 100644 --- a/crates/red_knot_python_semantic/src/types/infer.rs +++ b/crates/red_knot_python_semantic/src/types/infer.rs @@ -1796,14 +1796,13 @@ impl<'db> TypeInferenceBuilder<'db> { let ast::StmtTypeAlias { range: _, name, - type_params, + type_params: _, value, } = type_alias_statement; self.infer_expression(value); self.infer_expression(name); - if let Some(type_params) = type_params { - self.infer_type_parameters(type_params); - } + + // TODO: properly handle generic type aliases, which need their own annotation scope } fn infer_for_statement(&mut self, for_statement: &ast::StmtFor) { diff --git a/crates/red_knot_workspace/resources/test/corpus/89_type_alias.py b/crates/red_knot_workspace/resources/test/corpus/89_type_alias.py index 5bdfc4b05b..3acd9fb91e 100644 --- a/crates/red_knot_workspace/resources/test/corpus/89_type_alias.py +++ b/crates/red_knot_workspace/resources/test/corpus/89_type_alias.py @@ -1 +1,2 @@ type foo = int +type ListOrSet[T] = list[T] | set[T]