Commits

Daniel Roberts  committed 2630c86

Added test for name mangling of quasi immutable fields on pbc on ootype.

  • Participants
  • Parent commits 9371ae6

Comments (0)

Files changed (1)

File pypy/rpython/ootypesystem/test/test_oopbc.py

     res = interpret(f, [1], type_system='ootype')
     assert res == 2
 
+def test_quasi_immutable():
+    class A(object):
+        _immutable_fields_ = ['x?']
+        def __init__(self):
+            self.x = 3
+        def foo(self):
+            return self.x
+
+    a = A()
+
+    def f():
+        return a.foo()
+    
+    res = interpret(f, [], type_system='ootype')
+    assert res == 3