Commits

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)

pypy/annotation/bookkeeper.py

 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

pypy/jit/codegen/cli/test/test_interpreter.py

 
     def run_generated(self, writer, generated, residualargs, **kwds):
         if 'check_raises' not in kwds:
-            res = generated(*residualargs)
+            res = generated.DynamicInvoke(residualargs)
         else:
             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

pypy/translator/cli/dotnet.py

 CLR._buildtree()
 
 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,

pypy/translator/cli/src/pypylib.cs

         }
     }
 
+    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);