Skip to content
Snippets Groups Projects
Commit 3f5f25c4 authored by Daniel Bauer's avatar Daniel Bauer 💬
Browse files

fix typing of contants

parent 35545840
No related merge requests found
Pipeline #64796 passed with stages
in 2 minutes and 25 seconds
......@@ -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)
......
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