We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f63e27 commit 533541dCopy full SHA for 533541d
tests/test_basic.py
@@ -651,6 +651,27 @@ class Tree:
651
t = Tree('a', [t])
652
self.assertRaises(TypeError, Tree, 'a', [1])
653
654
+ def test_forward_reference_cache(self):
655
+ @dataclass
656
+ class A:
657
+ b: 'B'
658
+
659
+ class B:
660
+ pass
661
662
+ a = A(B())
663
+ self.assertRaises(TypeError, A, 1)
664
665
666
667
668
669
670
671
672
673
674
675
def test_unfrozen(self):
676
@dataclass(frozen=False, slots=False)
677
class A:
0 commit comments