Files
Semyon Proshev 0ee5f9152d PY-22971 Fixed: Support @typing.overload in regular Python files, not only in Python stubs
Introduce PyOverloadsInspection to check that implementation exists and is located after overloads.
The inspection also raise warning when overload signature is not compatible with the implementation.
2017-05-13 00:17:47 +03:00

37 lines
467 B
Python

from typing import overload
@overload
def foo(value: None) -> None:
pass
@overload
def foo(value: int) -> str:
pass
@overload
def foo(value: str) -> str:
pass
def foo(value):
return None
class A:
@overload
def foo(self, value: None) -> None:
pass
@overload
def foo(self, value: int) -> str:
pass
@overload
def foo(self, value: str) -> str:
pass
def foo(self, value):
return None