Exemplo n.º 1
0
 def fn():
     a = ArrayList()
     b = ArrayList()
     a.Add(b)
     c = a.get_Item(0) # type of c is Object
     c = clidowncast(c, ARRAY_LIST)
     c.Add(None)
     return c.get_Item(0)
Exemplo n.º 2
0
 def fn():
     a = ArrayList()
     b = ArrayList()
     a.Add(b)
     c = a.get_Item(0)  # type of c is Object
     c = clidowncast(c, ARRAY_LIST)
     c.Add(None)
     return c.get_Item(0)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 def finish_code(self):
     delegatetype = dotnet.typeof(LoopDelegate)
     # initialize the array of genconsts
     consts = dotnet.new_array(System.Object, len(self.consts))
     for av_const, i in self.consts.iteritems():
         consts[i] = av_const.get_cliobj()
     # build the delegate
     func = self.meth_wrapper.create_delegate(delegatetype, consts)
     return dotnet.clidowncast(func, LoopDelegate)
Exemplo n.º 5
0
Arquivo: method.py Projeto: sota/pypy
 def finish_code(self):
     delegatetype = dotnet.typeof(LoopDelegate)
     # initialize the array of genconsts
     consts = dotnet.new_array(System.Object, len(self.consts))
     for av_const, i in self.consts.iteritems():
         consts[i] = av_const.get_cliobj()
     # build the delegate
     func = self.meth_wrapper.create_delegate(delegatetype, consts)
     return dotnet.clidowncast(func, LoopDelegate)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 def fn():
     obj = box(c)
     t = clidowncast(obj, System.Type)
     return t.get_Name()
Exemplo n.º 8
0
 def fn(flag):
     if flag:
         x = a
     else:
         x = b
     return clidowncast(box(x), System.Type).get_Name()
Exemplo n.º 9
0
 def fn():
     utils_obj = box(utils_class)
     utils_type = clidowncast(utils_obj, System.Type)
     return utils_type.get_Name()
Exemplo n.º 10
0
 def fn():
     int32_obj = box(int32_class)
     int32_type = clidowncast(int32_obj, System.Type)
     return int32_type.get_Name()
Exemplo n.º 11
0
 def fn():
     obj = box(c)
     t = clidowncast(obj, System.Type)
     return t.get_Name()
Exemplo n.º 12
0
 def fn(flag):
     if flag:
         x = a
     else:
         x = b
     return clidowncast(box(x), System.Type).get_Name()
Exemplo n.º 13
0
 def fn():
     utils_obj = box(utils_class)
     utils_type = clidowncast(utils_obj, System.Type)
     return utils_type.get_Name()
Exemplo n.º 14
0
 def fn():
     int32_obj = box(int32_class)
     int32_type = clidowncast(int32_obj, System.Type)
     return int32_type.get_Name()