Skip to content

Commit 2f30c87

Browse files
committed
.
1 parent 916e686 commit 2f30c87

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mypy/semanal.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,7 +3782,7 @@ def analyze_type_alias_type_params(self, rvalue: CallExpr) -> TypeVarLikeList:
37823782
have_type_var_tuple = False
37833783
for tp_expr in type_params:
37843784
if isinstance(tp_expr, StarExpr):
3785-
tp_expr.valid = True
3785+
tp_expr.valid = False
37863786
self.analyze_type_expr(tp_expr)
37873787
try:
37883788
base = self.expr_to_unanalyzed_type(tp_expr)
@@ -3818,7 +3818,8 @@ def analyze_type_alias_type_params(self, rvalue: CallExpr) -> TypeVarLikeList:
38183818
code=codes.TYPE_VAR,
38193819
)
38203820
continue
3821-
declared_tvars.append(tvar)
3821+
if tvar:
3822+
declared_tvars.append(tvar)
38223823
return declared_tvars
38233824

38243825
def disable_invalid_recursive_aliases(

test-data/unit/check-type-aliases.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ partially_generic2: Ta3[int] = {1: "a"} # E: Dict entry 0 has incompatible type
11471147
Ta4 = TypeAliasType("Ta4", Tuple[Unpack[Ts]], type_params=(Ts, Ts1)) # E: Can only use one type var tuple in type_params argument to TypeAliasType
11481148

11491149
Ta5 = TypeAliasType("Ta5", Dict) # Unlike old style aliases, this is not generic
1150-
non_generic_dict: Ta5[int, str] # E: Bad number of arguments for type alias, expected: 0, given: 2
1150+
non_generic_dict: Ta5[int, str] # E: Bad number of arguments for type alias, expected 0, given 2
11511151

11521152
[builtins fixtures/dict.pyi]
11531153

0 commit comments

Comments
 (0)