Skip to content

Commit d8388e1

Browse files
committed
chore: changes to pass the tests
1 parent 582e455 commit d8388e1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mypy/messages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,10 +782,11 @@ def incompatible_argument(
782782
simple_message = self.prefer_simple_messages() and not decorator_context
783783

784784
if decorator_context:
785+
decorator = cast(Decorator, outer_context)
785786
arg_type_str, expected_type_str = format_type_distinctly(
786787
arg_type, expected_type, bare=True, options=self.options
787788
)
788-
func_name = outer_context.func.name
789+
func_name = decorator.func.name
789790
msg = (
790791
f'Decorated function "{func_name}" has incompatible type '
791792
f"{quote_type_string(arg_type_str)}; expected "

test-data/unit/check-functions.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3534,7 +3534,7 @@ def decorator2(f: Callable[P, None]) -> Callable[
35343534
def key2(x: int) -> None:
35353535
...
35363536

3537-
@decorator2(key2) # E: Argument 1 has incompatible type "def foo2(y: int) -> Coroutine[Any, Any, None]"; expected "def (x: int) -> Awaitable[None]"
3537+
@decorator2(key2) # E: Decorated function "foo2" has incompatible type "def foo2(y: int) -> Coroutine[Any, Any, None]"; expected "def (x: int) -> Awaitable[None]"
35383538
async def foo2(y: int) -> None:
35393539
...
35403540

0 commit comments

Comments
 (0)