From d1218c97bfba6803de7594c0b6ba138d5c74b745 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 1 Jul 2015 14:44:31 +0200 Subject: [PATCH] Tests for finding if branches that are correct. --- test/static_analysis/branches.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/static_analysis/branches.py b/test/static_analysis/branches.py index 21061d8f..6828d33c 100644 --- a/test/static_analysis/branches.py +++ b/test/static_analysis/branches.py @@ -30,3 +30,17 @@ if x == y: else: #! 6 type-error-operation z = x + y + +# ----------------- +# With a function +# ----------------- + +def addition(a, b): + if type(a) == type(b): + return a + b + else: + #! 9 type-error-operation + return a + b + +addition(1, 1) +addition(1.0, '')