Skip to content

Commit 9b6b9b0

Browse files
committed
Handle placeholder types better
1 parent e86356a commit 9b6b9b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypy/semanal.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,14 +1639,15 @@ def analyze_class(self, defn: ClassDef) -> None:
16391639

16401640
for tvd in tvar_defs:
16411641
if isinstance(tvd, TypeVarType) and any(
1642-
has_placeholder(t) for t in [tvd.upper_bound, tvd.default] + tvd.values
1642+
has_placeholder(t) for t in [tvd.upper_bound] + tvd.values
16431643
):
16441644
# Some type variable bounds or values are not ready, we need
16451645
# to re-analyze this class.
16461646
self.defer()
1647-
if has_placeholder(tvd.default):
1647+
if isinstance(tvd, TypeVarLikeType) and has_placeholder(tvd.default):
16481648
# Placeholder values in TypeVarLikeTypes may get substituted in.
16491649
# Defer current target until they are ready.
1650+
self.defer()
16501651
self.mark_incomplete(defn.name, defn)
16511652
return
16521653

0 commit comments

Comments
 (0)