Skip to content

Commit 0ae3b8d

Browse files
committed
Fix ParamSpec expandtype
1 parent 7f0e425 commit 0ae3b8d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

mypy/expandtype.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,15 @@ def visit_param_spec(self, t: ParamSpecType) -> Type:
251251
self.variables.get(t.id, t.copy_modified(prefix=Parameters([], [], [])))
252252
)
253253

254-
if has_param_specs(repl):
255-
if repl in self.recursive_guard:
256-
return repl
257-
self.recursive_guard.add(repl)
258-
repl = repl.accept(self)
259-
if t.has_default():
260-
repl = t.copy_modified(default=repl)
254+
while True:
255+
if has_param_specs(repl):
256+
if repl in self.recursive_guard:
257+
break
258+
self.recursive_guard.add(repl)
259+
repl = repl.accept(self)
260+
if t.has_default():
261+
repl = t.copy_modified(default=repl)
262+
break
261263

262264
if isinstance(repl, Instance):
263265
# TODO: what does prefix mean in this case?

0 commit comments

Comments
 (0)