Skip to content

Commit 4d3345b

Browse files
committed
apply make_simplified_union in messages.py instead of errors.py
1 parent 349292a commit 4d3345b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mypy/errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,14 @@ def yield_uselessness_error_infos(self) -> Iterator[tuple[str, Context, ErrorCod
271271
context.end_column = error_info[5]
272272
yield error_info[1], context, error_info[0]
273273

274-
def yield_revealed_type_infos(self) -> Iterator[tuple[Type, Context]]:
274+
def yield_revealed_type_infos(self) -> Iterator[tuple[list[Type], Context]]:
275275
"""Yield all types revealed in at least one iteration step."""
276276

277277
for note_info, types in self.revealed_types.items():
278278
context = Context(line=note_info[0], column=note_info[1])
279279
context.end_line = note_info[2]
280280
context.end_column = note_info[3]
281-
yield make_simplified_union(types), context
281+
yield types, context
282282

283283

284284
class IterationErrorWatcher(ErrorWatcher):

mypy/messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,8 +2510,8 @@ def match_statement_inexhaustive_match(self, typ: Type, context: Context) -> Non
25102510
def iteration_dependent_errors(self, iter_errors: IterationDependentErrors) -> None:
25112511
for error_info in iter_errors.yield_uselessness_error_infos():
25122512
self.fail(*error_info[:2], code=error_info[2])
2513-
for note_info, context in iter_errors.yield_revealed_type_infos():
2514-
self.reveal_type(note_info, context)
2513+
for types, context in iter_errors.yield_revealed_type_infos():
2514+
self.reveal_type(mypy.typeops.make_simplified_union(types), context)
25152515

25162516

25172517
def quote_type_string(type_string: str) -> str:

0 commit comments

Comments
 (0)