Files
openide/python/testData/highlighting/awaitInTuple.py
Mikhail Golubev fcf665e761 PY-64304 EA-247016 Report illegal usages of "await" expressions even if there is no operand
In other words, in a statement like "await = 42" there are now both a warning about
the missing operand and a warning that an await expression cannot be used as
an assignment target. This behavior is consistent with other expressions where
additional parsing errors are not special-cased.

GitOrigin-RevId: 37a68eacc7ec042435c185f9ddd8bc2eea42b40f
2024-04-24 09:03:57 +00:00

26 lines
623 B
Python

async def f51():
<error descr="Cannot assign to await expression">await</error><error descr="Expression expected"> </error>= 5 # fail
return (await<error descr="Expression expected">)</error> # fail
def f52():
await = 5
return (await)
async def f61():
<error descr="Cannot assign to await expression">await</error><error descr="Expression expected"> </error>= 5 # fail
return ("a", await<error descr="Expression expected">,</error> "b") # fail
def f62():
await = 5
return ("a", await, "b")
async def f71(x):
return (await x)
async def f72(x):
return ("a", await x, "b")