hdl.ast: raise a sensible error for xxx in Value

This commit is contained in:
Wanda 2024-01-13 13:39:02 +01:00 committed by Catherine
parent 86d14f584e
commit bf8faea51e
2 changed files with 8 additions and 0 deletions

View file

@ -377,6 +377,9 @@ class Value(metaclass=ABCMeta):
else:
raise TypeError(f"Cannot index value with {key!r}")
def __contains__(self, other):
raise TypeError("Cannot use 'in' with an Amaranth value")
def as_unsigned(self):
"""Conversion to unsigned.