You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix crash due to checking type variable values too early (#4384)
Move type variable checks which use subtype and type sameness
checks to happen at the end of semantic analysis.
The implementation also adds the concept of priorities to
semantic analysis patch callbacks. Callback calls are
sorted by the priority. We resolve forward references and
calculate fallbacks before checking type variable values,
as otherwise the latter could see incomplete types and crash.
Fixes#4200.
Copy file name to clipboardExpand all lines: test-data/unit/check-typeddict.test
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1333,7 +1333,7 @@ T = TypeVar('T', bound='M')
1333
1333
class G(Generic[T]):
1334
1334
x: T
1335
1335
1336
-
yb: G[int] # E: Type argument "builtins.int" of "G" must be a subtype of "TypedDict({'x': builtins.int}, fallback=typing.Mapping[builtins.str, builtins.object])"
1336
+
yb: G[int] # E: Type argument "builtins.int" of "G" must be a subtype of "TypedDict('__main__.M', {'x': builtins.int})"
0 commit comments