From 3554584038fea16e2220fefd48e6cef93dafe10a Mon Sep 17 00:00:00 2001
From: Daniel Bauer <daniel.j.bauer@fau.de>
Date: Thu, 28 Mar 2024 13:31:29 +0100
Subject: [PATCH] add regression test for typing of constants issue (fails on
 this commit)

---
 tests/nbackend/kernelcreation/test_typification.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/nbackend/kernelcreation/test_typification.py b/tests/nbackend/kernelcreation/test_typification.py
index 13d6deced..cb7e5561f 100644
--- a/tests/nbackend/kernelcreation/test_typification.py
+++ b/tests/nbackend/kernelcreation/test_typification.py
@@ -182,3 +182,14 @@ def test_typify_integer_binops_in_floating_context():
 
     with pytest.raises(TypificationError):
         expr = typify(expr)
+
+
+def test_regression_typify_constants():
+    ctx = KernelCreationContext(default_dtype=Fp(32))
+    freeze = FreezeExpressions(ctx)
+    typify = Typifier(ctx)
+
+    x, y = sp.symbols("x, y")
+    expr = (-x - y) ** 2
+
+    typify(freeze(expr))  # just test that no error is raised
-- 
GitLab