Files
openide/python/testData/resolve/TopLevelOverloadsAndImplementations.py
Semyon Proshev 947930f6c9 PY-22971 Fixed: Support @typing.overload in regular Python files, not only in Python stubs
Resolve:
* resolve to the first implementation in class, if there is no implementation, resolve to the first overload
* resolve to the last implementation in module, if there is no implementation, resolve to the last overload
2017-05-13 00:17:48 +03:00

28 lines
264 B
Python

from typing import overload
@overload
def foo(value: None) -> None:
pass
def foo(value):
return None
@overload
def foo(value: int) -> str:
pass
def foo(value):
return None
@overload
def foo(value: str) -> str:
pass
foo("abc")
<ref>