Skip to content
Snippets Groups Projects

Fix typing of constants

Merged Daniel Bauer requested to merge hyteg/pystencils:bauerd/fix-const-typing into backend-rework
1 unresolved thread
1 file
+ 3
5
Compare changes
  • Side-by-side
  • Inline
@@ -131,13 +131,11 @@ def test_typify_integer_binops():
@@ -131,13 +131,11 @@ def test_typify_integer_binops():
ctx.get_symbol("x", ctx.index_dtype)
ctx.get_symbol("x", ctx.index_dtype)
ctx.get_symbol("y", ctx.index_dtype)
ctx.get_symbol("y", ctx.index_dtype)
ctx.get_symbol("z", ctx.index_dtype)
x, y, z = sp.symbols("x, y, z")
x, y = sp.symbols("x, y")
expr = bit_shift_left(
expr = bit_shift_left(
bit_shift_right(bitwise_and(x, 2), bitwise_or(y, z)), bitwise_xor(2, 2)
bit_shift_right(bitwise_and(2, 2), bitwise_or(x, y)), bitwise_xor(2, 2)
) # ^
)
# TODO: x can not be a constant here, because then the typifier can not check that the arguments are integer.
expr = freeze(expr)
expr = freeze(expr)
expr = typify(expr)
expr = typify(expr)
Loading