From: whitequark Date: Thu, 18 Apr 2019 17:06:33 +0000 (+0000) Subject: hdl.xfrm: handle classes that inherit from Record. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7c28f642b10100819b29b8cd345937e8e661add7;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)