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

improve error messages

parent 23e7a9bb
No related branches found
No related tags found
No related merge requests found
Pipeline #64790 failed
...@@ -42,7 +42,9 @@ class PsSymbol: ...@@ -42,7 +42,9 @@ class PsSymbol:
def get_dtype(self) -> PsType: def get_dtype(self) -> PsType:
if self._dtype is None: 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 return self._dtype
def __eq__(self, other: object) -> bool: def __eq__(self, other: object) -> bool:
......
...@@ -655,7 +655,7 @@ class PsIeeeFloatType(PsScalarType): ...@@ -655,7 +655,7 @@ class PsIeeeFloatType(PsScalarType):
def __init__(self, width: int, const: bool = False): def __init__(self, width: int, const: bool = False):
if width not in self.SUPPORTED_WIDTHS: if width not in self.SUPPORTED_WIDTHS:
raise ValueError( 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) super().__init__(const)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment