diff --git a/src/pystencils/backend/kernelcreation/typification.py b/src/pystencils/backend/kernelcreation/typification.py
index dcfb0f548e6bbd91387ce8c72dc3dd313306ba07..9ef649b31ab0d548f8ce67c1aa685b5159b04f0a 100644
--- a/src/pystencils/backend/kernelcreation/typification.py
+++ b/src/pystencils/backend/kernelcreation/typification.py
@@ -96,7 +96,7 @@ class TypeContext:
         Otherwise, the expression is deferred, and a type will be applied to it as soon as `apply_type` is
         called on this context.
 
-        It the expression already has a data type set, it must be equal to the inferred type.
+        If the expression already has a data type set, it must be equal to the inferred type.
         """
 
         if self._target_type is None:
@@ -126,8 +126,15 @@ class TypeContext:
                         raise TypificationError(
                             f"Can't typify constant with non-numeric type {self._target_type}"
                         )
-                    c.apply_dtype(self._target_type)
-                
+                    if c.dtype is None:
+                        c.apply_dtype(self._target_type)
+                    elif deconstify(c.dtype) != self._target_type:
+                        raise TypificationError(
+                            f"Type mismatch at constant {c}: Constant type did not match the context's target type\n"
+                            f"  Constant type: {c.dtype}\n"
+                            f"    Target type: {self._target_type}"
+                        )
+
                 case PsSymbolExpr(symb):
                     symb.apply_dtype(self._target_type)
 
diff --git a/src/pystencils/backend/symbols.py b/src/pystencils/backend/symbols.py
index e1db5a930805939ffb28432023bc564158d8f43c..b007e3fcf4791e89bb34829f0c6e4b7d1dbbbd21 100644
--- a/src/pystencils/backend/symbols.py
+++ b/src/pystencils/backend/symbols.py
@@ -42,7 +42,9 @@ class PsSymbol:
 
     def get_dtype(self) -> PsType:
         if self._dtype is None:
-            raise PsInternalCompilerError("Symbol had no type assigned yet")
+            raise PsInternalCompilerError(
+                f"Symbol {self.name} had no type assigned yet"
+            )
         return self._dtype
 
     def __str__(self) -> str:
diff --git a/src/pystencils/types/basic_types.py b/src/pystencils/types/basic_types.py
index 7565ea9a5532ccbb0c394da46520054bdeb71f95..b83b6d7d67dfbc0fab0c873ca1fae2a55cc8517d 100644
--- a/src/pystencils/types/basic_types.py
+++ b/src/pystencils/types/basic_types.py
@@ -655,7 +655,7 @@ class PsIeeeFloatType(PsScalarType):
     def __init__(self, width: int, const: bool = False):
         if width not in self.SUPPORTED_WIDTHS:
             raise ValueError(
-                f"Invalid integer width; must be one of {self.SUPPORTED_WIDTHS}."
+                f"Invalid integer width {width}; must be one of {self.SUPPORTED_WIDTHS}."
             )
 
         super().__init__(const)
diff --git a/tests/nbackend/kernelcreation/test_typification.py b/tests/nbackend/kernelcreation/test_typification.py
index 9ff18623ea70a1da87308d1b7cc04dec9885489b..cb7e5561f994e0f40bdee4b6da6269d2d4232465 100644
--- a/tests/nbackend/kernelcreation/test_typification.py
+++ b/tests/nbackend/kernelcreation/test_typification.py
@@ -131,13 +131,11 @@ def test_typify_integer_binops():
 
     ctx.get_symbol("x", 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(
-        bit_shift_right(bitwise_and(x, 2), bitwise_or(y, z)), bitwise_xor(2, 2)
-    )  #                            ^
-    # TODO: x can not be a constant here, because then the typifier can not check that the arguments are integer.
+        bit_shift_right(bitwise_and(2, 2), bitwise_or(x, y)), bitwise_xor(2, 2)
+    )
     expr = freeze(expr)
     expr = typify(expr)
 
@@ -184,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