lib.data: ignore Python typing annotations in aggregate base class.

This commit is contained in:
Catherine 2023-03-03 03:45:12 +00:00
parent 90b374c17a
commit c1b9c64e10
2 changed files with 20 additions and 3 deletions

View file

@ -639,6 +639,16 @@ class StructTestCase(FHDLTestCase):
class Sd(Sb):
b: 1
def test_typing_annotation_coexistence(self):
class S(Struct):
a: unsigned(1)
b: int
c: str = "x"
self.assertEqual(Layout.of(S()), StructLayout({"a": unsigned(1)}))
self.assertEqual(S.__annotations__, {"b": int, "c": str})
self.assertEqual(S.c, "x")
class UnionTestCase(FHDLTestCase):
def test_construct(self):