diff --git a/test/static_analysis/branches.py b/test/static_analysis/branches.py index 3916f86f..ad2dedae 100644 --- a/test/static_analysis/branches.py +++ b/test/static_analysis/branches.py @@ -4,8 +4,22 @@ if random.choice([0, 1]): x = '' else: x = 1 - -if x != 1: - x = x.upper() +if random.choice([0, 1]): + y = '' else: + y = 1 + +# A simple test +if x != 1: + x.upper() +else: + #! 2 attribute-error + x.upper() pass + +# This operation is wrong, because the types could be different. +#! 6 type-error-operation +z = x + y +# However, here we have correct types. +if type(x) == type(y): + z = x + y diff --git a/test/static_analysis/operations.py b/test/static_analysis/operations.py index 71fbd230..05e1406c 100644 --- a/test/static_analysis/operations.py +++ b/test/static_analysis/operations.py @@ -9,3 +9,8 @@ -1 - int() int() - float() float() - 3.0 + +a = 3 +b = '' +#! 2 type-error-operation +a + b