Antonio Cuni committed 57f6b90

test_simple_fixed passes; we need to use DynamicInvoke to call the
delegate, else the result is wrong (not sure if it's a mono or
pythonnet bug)

Comments (0)

Files changed (4)


 from pypy.objspace.flow.model import Constant
 from pypy.annotation.model import SomeString, SomeChar, SomeFloat, \
      SomePtr, unionof, SomeInstance, SomeDict, SomeBuiltin, SomePBC, \
-     SomeInteger, SomeOOInstance, TLS, SomeAddress, \
+     SomeInteger, SomeOOInstance, SomeOOObject, TLS, SomeAddress, \
      SomeUnicodeCodePoint, SomeOOStaticMeth, s_None, s_ImpossibleValue, \
      SomeLLADTMeth, SomeBool, SomeTuple, SomeOOClass, SomeImpossibleValue, \
      SomeUnicodeString, SomeList, SomeObject, HarmlesslyBlocked, \
             result = SomeOOInstance(ootype.typeOf(x))
         elif isinstance(x, (ootype._record, ootype._string)):
             result = SomeOOInstance(ootype.typeOf(x))
+        elif isinstance(x, (ootype._object)):
+            result = SomeOOObject()
         elif callable(x):
             if hasattr(x, '__self__') and x.__self__ is not None:
                 # for cases like 'l.append' where 'l' is a global constant list


     def run_generated(self, writer, generated, residualargs, **kwds):
         if 'check_raises' not in kwds:
-            res = generated(*residualargs)
+            res = generated.DynamicInvoke(residualargs)
             assert False, 'TODO'
         return res
     test_simple_opt_const_propagation1 = skip
     test_simple_opt_const_propagation2 = skip
-    test_simple_fixed = skip
     test_red_switch = skip
     test_merge = skip
     test_loop_merging = skip


 known_delegates = {
+    ootype.StaticMethod([], ootype.Signed): CLR.pypy.test.DelegateType_int__0,
     ootype.StaticMethod([ootype.Signed, ootype.Float], ootype.Float): CLR.pypy.test.DelegateType_double_int_double,
     ootype.StaticMethod([ootype.Float], ootype.Float):         CLR.pypy.test.DelegateType_double__double_1,
     ootype.StaticMethod([ootype.Signed], ootype.Void):         CLR.pypy.test.DelegateType_void_int_1,


+    public delegate double DelegateType_int__0();
     public delegate double DelegateType_double__double_1(double a);
     public delegate double DelegateType_double_int_double(int a, double b);
     public delegate void DelegateType_void_int_1(int a);