8000 checker: remove default message from check_subtype (#13546) · python/mypy@92118a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 92118a9

Browse files
authored
checker: remove default message from check_subtype (#13546)
There isn't really a good reason to have a default here, feels like it mainly just increases the chance of a bug. Also remove the `del code` from the last PR.
1 parent c688f4a commit 92118a9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mypy/checker.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5602,7 +5602,7 @@ def check_subtype(
56025602
subtype: Type,
56035603
supertype: Type,
56045604
context: Context,
5605-
msg: ErrorMessage = message_registry.INCOMPATIBLE_TYPES,
5605+
msg: ErrorMessage,
56065606
subtype_label: str | None = None,
56075607
supertype_label: str | None = None,
56085608
*,
@@ -5615,7 +5615,7 @@ def check_subtype(
56155615
subtype: Type,
56165616
supertype: Type,
56175617
context: Context,
5618-
msg: str | ErrorMessage = message_registry.INCOMPATIBLE_TYPES,
5618+
msg: str | ErrorMessage,
56195619
subtype_label: str | None = None,
56205620
supertype_label: str | None = None,
56215621
*,
@@ -5628,7 +5628,6 @@ def check_subtype(
56285628

56295629
if isinstance(msg, str):
56305630
msg = ErrorMessage(msg, code=code)
5631-
del code
56325631

56335632
orig_subtype = subtype
56345633
subtype = get_proper_type(subtype)
@@ -5720,7 +5719,9 @@ def check_possible_missing_await(
57205719
aw_type = self.get_precise_awaitable_type(subtype, local_errors)
57215720
if aw_type is None:
57225721
return
5723-
if not self.check_subtype(aw_type, supertype, context):
5722+
if not self.check_subtype(
5723+
aw_type, supertype, context, msg=message_registry.INCOMPATIBLE_TYPES
5724+
):
57245725
return
57255726
self.msg.possible_missing_await(context)
57265727

0 commit comments

Comments
 (0)
0