Skip to content
Snippets Groups Projects
Commit 7526c0db authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Add clarifying docstring to TypeContext compatibility check

parent eb0ae32d
Branches
Tags
1 merge request!372Fix handling of constness in Typifier
Pipeline #64875 passed with stages
in 2 minutes and 10 seconds
......@@ -184,6 +184,11 @@ class TypeContext:
expr.dtype = self._target_type
def _compatible(self, dtype: PsType):
"""Checks whether the given data type is compatible with the context's target type.
If the target type is ``const``, they must be equal up to const qualification;
if the target type is not ``const``, `dtype` must match it exactly.
"""
assert self._target_type is not None
if self._target_type.const:
return constify(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