Skip to content
Snippets Groups Projects
Commit e3bede08 authored by Martin Bauer's avatar Martin Bauer
Browse files

Bugfix in automatic bool-double typing

parent 29266b82
Branches
Tags
No related merge requests found
...@@ -458,7 +458,9 @@ def typingFromSympyInspection(eqs, defaultType="double"): ...@@ -458,7 +458,9 @@ def typingFromSympyInspection(eqs, defaultType="double"):
""" """
result = defaultdict(lambda: defaultType) result = defaultdict(lambda: defaultType)
for eq in eqs: 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" result[eq.lhs.name] = "bool"
return result return result
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment