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

fix typing of contants

parent 35545840
Branches TextureDeclaration.__str__
Tags
No related merge requests found
Pipeline #64796 passed
...@@ -126,8 +126,15 @@ class TypeContext: ...@@ -126,8 +126,15 @@ class TypeContext:
raise TypificationError( raise TypificationError(
f"Can't typify constant with non-numeric type {self._target_type}" 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): case PsSymbolExpr(symb):
symb.apply_dtype(self._target_type) symb.apply_dtype(self._target_type)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment