def fn(flag): if flag: cls = cInt32 else: cls = cString clitype = class2type(cls) return clitype.get_FullName()
def compute_types(self): box2classes = {} # box --> [ootype.Class] self._collect_types(self.cliloop.operations, box2classes) for box, classes in box2classes.iteritems(): cls = classes[0] for cls2 in classes[1:]: if ootype.subclassof(cls, cls2): cls = cls2 else: assert ootype.subclassof(cls2, cls) self.box2type[box] = dotnet.class2type(cls)
def emit_op_guard_exception(self, op): il_label = self.newbranch(op) classbox = op.args[0] assert isinstance(classbox, ConstObj) oocls = classbox.getref(ootype.Class) clitype = dotnet.class2type(oocls) self.av_inputargs.load(self) self.il.Emit(OpCodes.Ldfld, self.exc_value_field) self.il.Emit(OpCodes.Isinst, clitype) self.il.Emit(OpCodes.Brfalse, il_label) # the guard succeeded, store the result self.av_inputargs.load(self) self.il.Emit(OpCodes.Ldfld, self.exc_value_field) self.store_result(op)
def get_self_clitype(self): return dotnet.class2type(self.selfclass)
def get_meth_info(self): clitype = dotnet.class2type(cpypyString) return clitype.GetMethod(self.methname + '')
def get_delegate_clitype(self): return dotnet.class2type(self.funcclass)
def get_clitype(self): return dotnet.class2type(self.ooclass)
def _get_meth_wrapper(self): restype = dotnet.class2type(cVoid) args = self._get_args_array([dotnet.typeof(InputArgs)]) return get_method_wrapper(self.name, restype, args)
def get_meth_info(self): clitype = dotnet.class2type(cpypyString) return clitype.GetMethod(self.methname+'')