Skip to content
Snippets Groups Projects
Commit 83b7c8cc authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Bugfix: Pystencils printed `const` twice on assignments to const numpy.dtypes

Pystencils will print two const when printing an assignment to a const numpy.dtype.
With the new type interference, this case can now occur more often
parent 0ff425f3
Branches bugfix-avoid-east-and-west-const
Tags
No related merge requests found
Pipeline #18487 passed with warnings
...@@ -229,7 +229,7 @@ class CBackend: ...@@ -229,7 +229,7 @@ class CBackend:
prefix = 'const ' prefix = 'const '
else: else:
prefix = '' prefix = ''
data_type = prefix + self._print(node.lhs.dtype) + " " data_type = prefix + self._print(node.lhs.dtype).replace(' const', '') + " "
return "%s%s = %s;" % (data_type, self.sympy_printer.doprint(node.lhs), return "%s%s = %s;" % (data_type, self.sympy_printer.doprint(node.lhs),
self.sympy_printer.doprint(node.rhs)) self.sympy_printer.doprint(node.rhs))
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment