lib.wiring: fix equality of FlippedSignature with other object.

Fixes #882.
This commit is contained in:
Catherine 2023-08-31 18:59:12 +00:00
parent cfd4f9c84e
commit 44d5fac01c
2 changed files with 17 additions and 3 deletions

View file

@ -832,3 +832,15 @@ class ComponentTestCase(unittest.TestCase):
r"a signature member; did you mean 'val2: In\(MockValueCastable\)' or "
r"'val2: Out\(MockValueCastable\)'\?$"):
C3().signature
def test_bug_882(self):
class PageBuffer(Component):
rand: Signature({}).flip()
other: Out(1)
with self.assertWarnsRegex(SyntaxWarning,
r"^Component '.+\.PageBuffer' has an annotation 'rand: Signature\({}\)\.flip\(\)', "
r"which is not a signature member; did you mean "
r"'rand: In\(Signature\({}\)\.flip\(\)\)' or "
r"'rand: Out\(Signature\({}\)\.flip\(\)\)'\?$"):
PageBuffer()