From: whitequark Date: Thu, 18 Apr 2019 17:06:33 +0000 (+0000) Subject: hdl.xfrm: handle classes that inherit from Record. X-Git-Tag: working~14 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dda8f34d396a000801243d17a69284c35790b577;p=nmigen.git hdl.xfrm: handle classes that inherit from Record. --- diff --git a/nmigen/hdl/xfrm.py b/nmigen/hdl/xfrm.py index 7c51a61..1385ce8 100644 --- a/nmigen/hdl/xfrm.py +++ b/nmigen/hdl/xfrm.py @@ -89,7 +89,8 @@ class ValueVisitor(metaclass=ABCMeta): new_value = self.on_AnySeq(value) elif type(value) is Signal: new_value = self.on_Signal(value) - elif type(value) is Record: + elif isinstance(value, Record): + # Uses `isinstance()` and not `type() is` to allow inheriting from Record. new_value = self.on_Record(value) elif type(value) is ClockSignal: new_value = self.on_ClockSignal(value)