mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
PY-55548 Use actual return type for "Specify return type using annotation"
For async functions, unwrap return type from Awaitable or Coroutine Merge-request: IJ-MR-146295 Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com> (cherry picked from commit 9fe8d02a9d8bb584b9d6972ce999912bd93875e6) IJ-MR-146295 GitOrigin-RevId: 9bad4877a069268a2d0181cac70b9a0d399cb5e6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3bf01bc0c5
commit
d5f9bf8de0
@@ -1,2 +1,2 @@
|
||||
def foo(x: object, y: object) -> object:
|
||||
def foo(x: object, y: object) -> None:
|
||||
pass
|
||||
@@ -1,4 +1,4 @@
|
||||
def foo(x: object, y: object) -> object:
|
||||
def foo(x: object, y: object) -> None:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
def foo(x: object, y: object) -> object:
|
||||
def foo(x: object, y: object) -> None:
|
||||
pass
|
||||
@@ -1,2 +1,2 @@
|
||||
def foo(**x: object<caret>) -> object:
|
||||
def foo(**x: object<caret>) -> None:
|
||||
pass
|
||||
@@ -1,2 +1,2 @@
|
||||
def foo(x: bool<caret>, y: bool) -> object:
|
||||
def foo(x: bool<caret>, y: bool) -> str:
|
||||
return "42"
|
||||
@@ -1,2 +1,2 @@
|
||||
def foo(*x: object<caret>, **y: object) -> object:
|
||||
def foo(*x: object<caret>, **y: object) -> None:
|
||||
pass
|
||||
@@ -3,7 +3,7 @@ class MyClass:
|
||||
pass
|
||||
|
||||
def method(self, x):
|
||||
# type: (object) -> object
|
||||
# type: (object) -> None
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
def foo(x, y):
|
||||
# type: (object, object) -> object
|
||||
# type: (object, object) -> None
|
||||
pass
|
||||
@@ -0,0 +1,5 @@
|
||||
async def bar() -> int:
|
||||
return 42
|
||||
|
||||
def fo<caret>o(x, y):
|
||||
return bar()
|
||||
@@ -0,0 +1,8 @@
|
||||
from typing import Any, Coroutine
|
||||
|
||||
|
||||
async def bar() -> int:
|
||||
return 42
|
||||
|
||||
def foo(x, y) -> Coroutine[Any, Any, int]:
|
||||
return bar()
|
||||
@@ -1,2 +1,2 @@
|
||||
def foo(x, y) -> object:
|
||||
def foo(x, y) -> None:
|
||||
pass
|
||||
@@ -1,4 +1,4 @@
|
||||
def foo(x, y) -> object:
|
||||
def foo(x, y) -> None:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
def foo(x, y) -> object:
|
||||
def foo(x, y) -> None:
|
||||
pass
|
||||
@@ -0,0 +1,2 @@
|
||||
async def fo<caret>o(x, y):
|
||||
return 42
|
||||
@@ -0,0 +1,2 @@
|
||||
async def foo(x, y) -> int:
|
||||
return 42
|
||||
@@ -1,4 +1,4 @@
|
||||
def my_func(p1=1) -> object:
|
||||
def my_func(p1=1) -> int:
|
||||
return p1
|
||||
|
||||
d = my_func(1)
|
||||
@@ -1,4 +1,4 @@
|
||||
def my_func(p1=1) -> object:
|
||||
def my_func(p1=1) -> int:
|
||||
return p1
|
||||
|
||||
d = my_func(1)
|
||||
@@ -1,4 +1,4 @@
|
||||
def foo() -> object:
|
||||
def foo() -> None:
|
||||
@decorator
|
||||
def bar():
|
||||
pass
|
||||
@@ -1,4 +1,4 @@
|
||||
def foo() -> object:
|
||||
def foo() -> None:
|
||||
@decorator
|
||||
def bar():
|
||||
pass
|
||||
@@ -1,4 +1,7 @@
|
||||
def g(x) -> object:
|
||||
from typing import Any
|
||||
|
||||
|
||||
def g(x) -> Any:
|
||||
return x
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user