"Fossies" - the Fresh Open Source Software Archive  

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

unionTest.ml  (pyre-check-0.0.54):unionTest.ml  (pyre-check-0.0.55)
skipping to change at line 148 skipping to change at line 148
... ...
class GetItem: class GetItem:
def __getitem__(self, x: int) -> Equal: def __getitem__(self, x: int) -> Equal:
... ...
class Contains: class Contains:
def __contains__(self, a: object) -> bool: def __contains__(self, a: object) -> bool:
... ...
def foo(a: typing.Union[GetItem, Contains]) -> None: def foo(a: typing.Union[GetItem, Contains]) -> None:
5 in a 5 in a
|} |}
["Undefined attribute [16]: `Contains` has no attribute `__getitem__`."]; [
"Unsupported operand [58]: `in` is not supported for right operand type \
`typing.Union[Contains, GetItem]`.";
];
assert_type_errors assert_type_errors
{| {|
import typing import typing
def f(x: typing.Optional[typing.Union[int, str]]) -> None: def f(x: typing.Optional[typing.Union[int, str]]) -> None:
return g(x) return g(x)
def g(x: typing.Union[typing.Optional[int], typing.Optional[str]]) -> None : def g(x: typing.Union[typing.Optional[int], typing.Optional[str]]) -> None :
return f(x) return f(x)
|} |}
[]; [];
 End of changes. 1 change blocks. 
1 lines changed or deleted 4 lines changed or added

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