コード例 #1
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn(flag):
     a = ArrayList()
     a.Add(None)
     if flag:
         obj = cliupcast(a, System.Object)
     else:
         obj = box(42)
     b = clidowncast(obj, ArrayList)
     return b.get_Item(0)
コード例 #2
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn(flag):
     a = ArrayList()
     a.Add(None)
     if flag:
         obj = cliupcast(a, System.Object)
     else:
         obj = box(42)
     b = clidowncast(obj, ArrayList)
     return b.get_Item(0)
コード例 #3
0
ファイル: interp_clr.py プロジェクト: sota/pypy
def call_method(space, b_obj, b_type, name, w_args, startfrom):
    b_args, b_paramtypes = rewrap_args(space, w_args, startfrom)
    b_meth = get_method(space, b_type, name, b_paramtypes)
    try:
        # for an explanation of the box() call, see the log message for revision 35167
        b_res = box(b_meth.Invoke(b_obj, b_args))
    except TargetInvocationException, e:
        b_inner = native_exc(e).get_InnerException()
        message = str(b_inner.get_Message())
        # TODO: use the appropriate exception, not StandardError
        raise OperationError(space.w_StandardError, space.wrap(message))
コード例 #4
0
ファイル: interp_clr.py プロジェクト: sota/pypy-old
def call_method(space, b_obj, b_type, name, w_args, startfrom):
    b_args, b_paramtypes = rewrap_args(space, w_args, startfrom)
    b_meth = get_method(space, b_type, name, b_paramtypes)
    try:
        # for an explanation of the box() call, see the log message for revision 35167
        b_res = box(b_meth.Invoke(b_obj, b_args))
    except TargetInvocationException, e:
        b_inner = native_exc(e).get_InnerException()
        message = str(b_inner.get_Message())
        # TODO: use the appropriate exception, not StandardError
        raise OperationError(space.w_StandardError, space.wrap(message))
コード例 #5
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = ArrayList()
     t = x.GetType()
     meth = t.GetMethod('get_Item')
     args = init_array(System.Object, box(0))
     try:
         meth.Invoke(x, args)
         return "Impossible!"
     except TargetInvocationException, e:
         inner = native_exc(e).get_InnerException()
         message = str(inner.get_Message())
         return message
コード例 #6
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = ArrayList()
     t = x.GetType()
     meth = t.GetMethod('get_Item')
     args = init_array(System.Object, box(0))
     try:
         meth.Invoke(x, args)
         return "Impossible!"
     except TargetInvocationException, e:
         inner = native_exc(e).get_InnerException()
         message = str(inner.get_Message())
         return message
コード例 #7
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = ArrayList()
     x.Add(box('foo'))
     return unbox(x.get_Item(0), ootype.String)
コード例 #8
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = ArrayList()
     x.Add(box(42))
     x.Add(box('Foo'))
     return x.get_Count()
コード例 #9
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = ArrayList()
     x.Add(box(42))
     x.Add(box('Foo'))
     return x.get_Count()
コード例 #10
0
 def tocli(self):
     return box(self.intval)
コード例 #11
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn(flag):
     a = ootype.new(A)
     a.xx = 42
     b_obj = box(a)
     a2 = unbox(b_obj, A)
     return a2.xx
コード例 #12
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = ArrayList()
     x.Add(box(42))
     return unbox(x.get_Item(0), ootype.Signed)
コード例 #13
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = init_array(System.Object, box(42), box(43))
     x[0] = None
     return x[0]
コード例 #14
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = box(42)
     return x.GetType() ==  typeof(System.Int32)
コード例 #15
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = init_array(System.Object, box(42), box(43))
     return len(x)
コード例 #16
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = init_array(System.Object, box(42), box(43))
     x[0] = None
     return x[0]
コード例 #17
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = init_array(System.Object, box(42), box(43))
     return unbox(x[0], ootype.Signed) + unbox(x[1], ootype.Signed)
コード例 #18
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = new_array(System.Object, 2)
     x[0] = box(42)
     x[1] = box(43)
     return unbox(x[0], ootype.Signed) + unbox(x[1], ootype.Signed)
コード例 #19
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = ArrayList()
     x.Add(box(42))
     array = x.ToArray()
     return unbox(array[0], ootype.Signed)
コード例 #20
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     return box(System.Object()).ToString()
コード例 #21
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = new_array(System.Object, 2)
     x[0] = box(42)
     x[1] = box(43)
     return unbox(x[0], ootype.Signed) + unbox(x[1], ootype.Signed)
コード例 #22
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = ArrayList()
     x.Add(box('foo'))
     return unbox(x.get_Item(0), ootype.String)
コード例 #23
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn(flag):
     if flag:
         x = None
     else:
         x = box(42)
     return g(x)
コード例 #24
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     obj = Foo()
     b_obj = box(obj)
     obj2 = unbox(b_obj, Foo)
     return obj is obj2
コード例 #25
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     obj = Foo()
     b_obj = box(obj)
     obj2 = unbox(b_obj, Foo)
     return obj is obj2
コード例 #26
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     b_obj = box(42)
     return unbox(b_obj, Foo)
コード例 #27
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     return box(System.Object()).ToString()
コード例 #28
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn(flag):
     a = ootype.new(A)
     a.xx = 42
     b_obj = box(a)
     a2 = unbox(b_obj, A)
     return a2.xx
コード例 #29
0
 def tocli(self):
     return box(self.boolval)
コード例 #30
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     obj = Foo()
     x = ArrayList()
     x.Add(box(obj))
     obj2 = unbox(x.get_Item(0), Foo)
     return obj is obj2
コード例 #31
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = StringBuilder()
     x.Append(box("foo")).Append(box("bar"))
     return x.ToString()
コード例 #32
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     int32_obj = box(int32_class)
     int32_type = clidowncast(int32_obj, System.Type)
     return int32_type.get_Name()
コード例 #33
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = ArrayList()
     x.Add(box(42))
     return unbox(x.get_Item(0), ootype.Signed)
コード例 #34
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     utils_obj = box(utils_class)
     utils_type = clidowncast(utils_obj, System.Type)
     return utils_type.get_Name()
コード例 #35
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = box(42)
     t = x.GetType()
     return t.get_Name()
コード例 #36
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn(flag):
     if flag:
         x = a
     else:
         x = b
     return clidowncast(box(x), System.Type).get_Name()
コード例 #37
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = ArrayList()
     x.Add(box(42))
     array = x.ToArray()
     return unbox(array[0], ootype.Signed)
コード例 #38
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     obj = box(c)
     t = clidowncast(obj, System.Type)
     return t.get_Name()
コード例 #39
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = init_array(System.Object, box(42), box(43))
     return unbox(x[0], ootype.Signed) + unbox(x[1], ootype.Signed)
コード例 #40
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     return box(42)
コード例 #41
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = init_array(System.Object, box(42), box(43))
     return len(x)
コード例 #42
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn(flag):
     if flag:
         return box(42)
     else:
         return box(None)
コード例 #43
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = box(42)
     return x.GetType() == typeof(System.Int32)
コード例 #44
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     int32_obj = box(int32_class)
     int32_type = clidowncast(int32_obj, System.Type)
     return int32_type.get_Name()
コード例 #45
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn(flag):
     if flag:
         x = None
     else:
         x = box(42)
     return g(x)
コード例 #46
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn(flag):
     if flag:
         x = a
     else:
         x = b
     return clidowncast(box(x), System.Type).get_Name()
コード例 #47
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     b_obj = box(42)
     return unbox(b_obj, Foo)
コード例 #48
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     return box(42)
コード例 #49
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     obj = Foo()
     x = ArrayList()
     x.Add(box(obj))
     obj2 = unbox(x.get_Item(0), Foo)
     return obj is obj2
コード例 #50
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = box(42)
     t = x.GetType()
     return t.get_Name()
コード例 #51
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     utils_obj = box(utils_class)
     utils_type = clidowncast(utils_obj, System.Type)
     return utils_type.get_Name()
コード例 #52
0
ファイル: boxing_rules.py プロジェクト: sota/pypy
 def tocli(self):
     return box(self)
コード例 #53
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     obj = box(c)
     t = clidowncast(obj, System.Type)
     return t.get_Name()
コード例 #54
0
ファイル: boxing_rules.py プロジェクト: sota/pypy
 def tocli(self):
     return box(self.intval)
コード例 #55
0
 def tocli(self):
     return box(self)
コード例 #56
0
ファイル: boxing_rules.py プロジェクト: sota/pypy
 def tocli(self):
     return box(self.floatval)
コード例 #57
0
 def tocli(self):
     return box(self.floatval)
コード例 #58
0
ファイル: boxing_rules.py プロジェクト: sota/pypy
 def tocli(self):
     return box(self.boolval)
コード例 #59
0
 def tocli(self):
     return box(self._value)
コード例 #60
0
ファイル: boxing_rules.py プロジェクト: sota/pypy
 def tocli(self):
     return box(self._value)