@@ -93,7 +93,7 @@ async def f() -> int:
93
93
return x
94
94
[typing fixtures/typing-full.pyi]
95
95
[out]
96
- main:7: error: Incompatible types in await (actual type "Generator[int, None, str]", expected type "Awaitable[Any]")
96
+ main:7: error: Incompatible types in " await" (actual type "Generator[int, None, str]", expected type "Awaitable[Any]")
97
97
98
98
[case testAwaitIteratorError]
99
99
@@ -105,7 +105,7 @@ async def f() -> int:
105
105
return x
106
106
[typing fixtures/typing-full.pyi]
107
107
[out]
108
- main:6: error: Incompatible types in await (actual type "Iterator[Any]", expected type "Awaitable[Any]")
108
+ main:6: error: Incompatible types in " await" (actual type "Iterator[Any]", expected type "Awaitable[Any]")
109
109
110
110
[case testAwaitArgumentError]
111
111
@@ -117,7 +117,7 @@ async def f() -> int:
117
117
[builtins fixtures/async_await.pyi]
118
118
[typing fixtures/typing-full.pyi]
119
119
[out]
120
- main:5: error: Incompatible types in await (actual type "int", expected type "Awaitable[Any]")
120
+ main:5: error: Incompatible types in " await" (actual type "int", expected type "Awaitable[Any]")
121
121
122
122
[case testAwaitResultError]
123
123
@@ -290,7 +290,7 @@ class C:
290
290
def __aenter__(self) -> int: pass
291
291
async def __aexit__(self, x, y, z) -> None: pass
292
292
async def f() -> None:
293
- async with C() as x: # E: Incompatible types in "async with" for __aenter__ (actual type "int", expected type "Awaitable[Any]")
293
+ async with C() as x: # E: Incompatible types in "async with" for " __aenter__" (actual type "int", expected type "Awaitable[Any]")
294
294
pass
295
295
[builtins fixtures/async_await.pyi]
296
296
[typing fixtures/typing-full.pyi]
@@ -312,7 +312,7 @@ class C:
312
312
async def __aenter__(self) -> int: pass
313
313
def __aexit__(self, x, y, z) -> int: pass
314
314
async def f() -> None:
315
- async with C() as x: # E: Incompatible types in "async with" for __aexit__ (actual type "int", expected type "Awaitable[Any]")
315
+ async with C() as x: # E: Incompatible types in "async with" for " __aexit__" (actual type "int", expected type "Awaitable[Any]")
316
316
pass
317
317
[builtins fixtures/async_await.pyi]
318
318
[typing fixtures/typing-full.pyi]
@@ -419,7 +419,7 @@ from types import coroutine
419
419
@coroutine
420
420
def f() -> Generator[int, str, int]:
421
421
x = yield 0
422
- x = yield '' # E: Incompatible types in yield (actual type "str", expected type "int")
422
+ x = yield '' # E: Incompatible types in " yield" (actual type "str", expected type "int")
423
423
reveal_type(x) # E: Revealed type is 'builtins.str'
424
424
if x:
425
425
return 0
@@ -443,7 +443,7 @@ async def g() -> AsyncGenerator[int, None]:
443
443
reveal_type(value) # E: Revealed type is 'builtins.int*'
444
444
yield value
445
445
446
- yield 'not an int' # E: Incompatible types in yield (actual type "str", expected type "int")
446
+ yield 'not an int' # E: Incompatible types in " yield" (actual type "str", expected type "int")
447
447
# return without a value is fine
448
448
return
449
449
reveal_type(g) # E: Revealed type is 'def () -> typing.AsyncGenerator[builtins.int, builtins.None]'
@@ -466,7 +466,7 @@ from typing import AsyncIterator
466
466
async def gen() -> AsyncIterator[int]:
467
467
yield 3
468
468
469
- yield 'not an int' # E: Incompatible types in yield (actual type "str", expected type "int")
469
+ yield 'not an int' # E: Incompatible types in " yield" (actual type "str", expected type "int")
470
470
471
471
async def use_gen() -> None:
472
472
async for item in gen():
@@ -644,11 +644,11 @@ def plain_host_generator() -> Generator[str, None, None]:
644
644
645
645
async def plain_host_coroutine() -> None:
646
646
x = 0
647
- x = await plain_generator() # E: Incompatible types in await (actual type "Generator[str, None, int]", expected type "Awaitable[Any]")
647
+ x = await plain_generator() # E: Incompatible types in " await" (actual type "Generator[str, None, int]", expected type "Awaitable[Any]")
648
648
x = await plain_coroutine()
649
649
x = await decorated_generator()
650
650
x = await decorated_coroutine()
651
- x = await other_iterator() # E: Incompatible types in await (actual type "It", expected type "Awaitable[Any]")
651
+ x = await other_iterator() # E: Incompatible types in " await" (actual type "It", expected type "Awaitable[Any]")
652
652
x = await other_coroutine()
653
653
654
654
@coroutine
@@ -665,11 +665,11 @@ def decorated_host_generator() -> Generator[str, None, None]:
665
665
@coroutine
666
666
async def decorated_host_coroutine() -> None:
667
667
x = 0
668
- x = await plain_generator() # E: Incompatible types in await (actual type "Generator[str, None, int]", expected type "Awaitable[Any]")
668
+ x = await plain_generator() # E: Incompatible types in " await" (actual type "Generator[str, None, int]", expected type "Awaitable[Any]")
669
669
x = await plain_coroutine()
670
670
x = await decorated_generator()
671
671
x = await decorated_coroutine()
672
- x = await other_iterator() # E: Incompatible types in await (actual type "It", expected type "Awaitable[Any]")
672
+ x = await other_iterator() # E: Incompatible types in " await" (actual type "It", expected type "Awaitable[Any]")
673
673
x = await other_coroutine()
674
674
675
675
[builtins fixtures/async_await.pyi]
0 commit comments