"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "analysis/test/integration/decoratorTest.ml" between
pyre-check-0.0.54.tar.gz and pyre-check-0.0.55.tar.gz

About: Pyre is a performant type checker for Python (ships with Pysa, a security focused static analysis tool).

decoratorTest.ml  (pyre-check-0.0.54):decoratorTest.ml  (pyre-check-0.0.55)
skipping to change at line 401 skipping to change at line 401
from typing import Any from typing import Any
def my_decorator(x: int) -> Any: ... def my_decorator(x: int) -> Any: ...
@my_decorator(1 + "foo") @my_decorator(1 + "foo")
def f(x: int) -> int: def f(x: int) -> int:
return x return x
|} |}
[ [
"Missing return annotation [3]: Return type must be specified as type othe r than `Any`."; "Missing return annotation [3]: Return type must be specified as type othe r than `Any`.";
"Invalid decoration [56]: Pyre was not able to infer the type of argument \ "Invalid decoration [56]: Pyre was not able to infer the type of argument \
`1.__add__(\"foo\")` to decorator factory `test.my_decorator`."; `1.__add__(\"foo\")` to decorator factory `test.my_decorator`.";
"Incompatible parameter type [6]: `+` is not supported for operand types ` int` and `str`."; "Unsupported operand [58]: `+` is not supported for operand types `int` an d `str`.";
]; ];
assert_type_errors assert_type_errors
{| {|
from typing import overload, Callable from typing import overload, Callable
@overload @overload
def overloaded_decorator(f: Callable[[int], int]) -> Callable[[str], int]: ... def overloaded_decorator(f: Callable[[int], int]) -> Callable[[str], int]: ...
@overload @overload
def overloaded_decorator(f: Callable[[int], str]) -> Callable[[bool], floa t]: ... def overloaded_decorator(f: Callable[[int], str]) -> Callable[[bool], floa t]: ...
def overloaded_decorator(f: object) -> object: ... def overloaded_decorator(f: object) -> object: ...
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)