Author: Alex Gaynor <alex.gay...@gmail.com>
Branch: 
Changeset: r65283:a788df771340
Date: 2013-07-09 21:36 +1000
http://bitbucket.org/pypy/pypy/changeset/a788df771340/

Log:    A failing test of taking the union of a type and a PBC

diff --git a/rpython/annotator/test/test_annrpython.py 
b/rpython/annotator/test/test_annrpython.py
--- a/rpython/annotator/test/test_annrpython.py
+++ b/rpython/annotator/test/test_annrpython.py
@@ -740,6 +740,32 @@
         s = a.build_types(f, [B])
         assert s.classdef is a.bookkeeper.getuniqueclassdef(C)
 
+    def test_union_type_some_opbc(self):
+        class A(object):
+            def f(self):
+                return type(self)
+
+        class B(A):
+            pass
+
+        def f(tp):
+            return tp
+
+        def main(n):
+            if n:
+                if n == 1:
+                    inst = A()
+                else:
+                    inst = B()
+                arg = inst.f()
+            else:
+                arg = B
+            return f(arg).__name__
+
+        a = self.RPythonAnnotator()
+        s = a.build_types(main, [int])
+        assert isinstance(s, annmodel.SomeString)
+
     def test_ann_assert(self):
         def assert_(x):
             assert x,"XXX"
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to