Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,13 @@ def invalid_signature_for_special_method(

def reveal_type(self, typ: Type, context: Context) -> None:
visitor = TypeStrVisitor(options=self.options)
self.note(f'Revealed type is "{typ.accept(visitor)}"', context)
proper_type = get_proper_type(typ) # Resolve any type aliases or partial types

# Check if the type is UninhabitedType (unreachable code)
if isinstance(proper_type, UninhabitedType):
self.note('Revealed type is "Never"', context)
else:
self.note(f'Revealed type is "{proper_type.accept(visitor)}"', context)

def reveal_locals(self, type_map: dict[str, Type | None], context: Context) -> None:
# To ensure that the output is predictable on Python < 3.6,
Expand Down
Loading