"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "analysis/test/integration/inferTest.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).

inferTest.ml  (pyre-check-0.0.54):inferTest.ml  (pyre-check-0.0.55)
skipping to change at line 208 skipping to change at line 208
]; ];
assert_type_errors assert_type_errors
{| {|
def foo() -> None: def foo() -> None:
if a > 10: if a > 10:
return None return None
else: else:
return 1 return 1
|} |}
[ [
"Incompatible parameter type [6]: `>` is not supported for operand types ` unknown` and `int`.";
"Unbound name [10]: Name `a` is used but not defined in the current scope. "; "Unbound name [10]: Name `a` is used but not defined in the current scope. ";
"Unsupported operand [58]: `>` is not supported for operand types `unknown ` and `int`.";
"Incompatible return type [7]: Expected `None` but got `int`."; "Incompatible return type [7]: Expected `None` but got `int`.";
]; ];
assert_type_errors assert_type_errors
{| {|
import typing import typing
def foo(x) -> typing.Any: def foo(x) -> typing.Any:
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`.";
skipping to change at line 301 skipping to change at line 301
pass pass
|} []; |} [];
assert_default_type_errors {| assert_default_type_errors {|
def foo(x): def foo(x):
return x return x
|} []; |} [];
assert_default_type_errors assert_default_type_errors
{| {|
1 + 'asdf' # report in top-level function 1 + 'asdf' # report in top-level function
|} |}
["Incompatible parameter type [6]: `+` is not supported for operand types `i nt` and `str`."]; ["Unsupported operand [58]: `+` is not supported for operand types `int` and `str`."];
assert_type_errors assert_type_errors
{| {|
from builtins import condition from builtins import condition
import typing import typing
def foo() -> typing.Any: def foo() -> typing.Any:
if condition(): if condition():
return 1 return 1
|} |}
[ [
"Missing return annotation [3]: Returning `typing.Optional[int]` but " "Missing return annotation [3]: Returning `typing.Optional[int]` but "
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added

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