From e3bede087ea936aeca0a0af8b80f7558912d8a7a Mon Sep 17 00:00:00 2001 From: Martin Bauer <martin.bauer@fau.de> Date: Thu, 24 Nov 2016 10:45:23 +0100 Subject: [PATCH] Bugfix in automatic bool-double typing --- transformations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/transformations.py b/transformations.py index 565367b9a..ddeef910e 100644 --- a/transformations.py +++ b/transformations.py @@ -458,7 +458,9 @@ def typingFromSympyInspection(eqs, defaultType="double"): """ result = defaultdict(lambda: defaultType) for eq in eqs: - if isinstance(eq.rhs, Boolean): + # problematic case here is when rhs is a symbol: then it is impossible to decide here without + # further information what type the left hand side is - default fallback is the dict value then + if isinstance(eq.rhs, Boolean) and not isinstance(eq.rhs, sp.Symbol): result[eq.lhs.name] = "bool" return result -- GitLab