예제 #1
0
파일: dotnet.py 프로젝트: griels/pypy-sc
 def compute_result_annotation(self, type_s, length_s):
     from pypy.translator.cli.query import get_cli_class
     assert type_s.is_constant()
     assert isinstance(length_s, SomeInteger)
     TYPE = type_s.const._INSTANCE
     fullname = '%s.%s[]' % (TYPE._namespace, TYPE._classname)
     cliArray = get_cli_class(fullname)
     return SomeOOInstance(cliArray._INSTANCE)
예제 #2
0
파일: dotnet.py 프로젝트: alkorzt/pypy
 def compute_result_annotation(self, type_s, length_s):
     from pypy.translator.cli.query import get_cli_class
     assert type_s.is_constant()
     assert isinstance(length_s, SomeInteger)
     TYPE = type_s.const._INSTANCE
     fullname = '%s.%s[]' % (TYPE._namespace, TYPE._classname)
     cliArray = get_cli_class(fullname)
     return SomeOOInstance(cliArray._INSTANCE)
예제 #3
0
파일: dotnet.py 프로젝트: alkorzt/pypy
 def simple_call(self, *s_args):
     from pypy.translator.cli.query import get_cli_class
     DELEGATE = get_cli_class('System.Delegate')._INSTANCE
     if ootype.isSubclass(self.ootype, DELEGATE):
         s_invoke = self.getattr(immutablevalue('Invoke'))
         return s_invoke.simple_call(*s_args)
     else:
         # cannot call a non-delegate
         return SomeObject.simple_call(self, *s_args)
예제 #4
0
파일: dotnet.py 프로젝트: griels/pypy-sc
 def simple_call(self, *s_args):
     from pypy.translator.cli.query import get_cli_class
     DELEGATE = get_cli_class('System.Delegate')._INSTANCE
     if ootype.isSubclass(self.ootype, DELEGATE):
         s_invoke = self.getattr(immutablevalue('Invoke'))
         return s_invoke.simple_call(*s_args)
     else:
         # cannot call a non-delegate
         return SomeObject.simple_call(self, *s_args)
예제 #5
0
파일: dotnet.py 프로젝트: alkorzt/pypy
 def compute_result_annotation(self, type_s, *args_s):
     from pypy.translator.cli.query import get_cli_class
     assert type_s.is_constant()
     TYPE = type_s.const._INSTANCE
     for i, arg_s in enumerate(args_s):
         if TYPE is not arg_s.ootype:
             raise TypeError, 'Wrong type of arg #%d: %s expected, %s found' % \
                   (i, TYPE, arg_s.ootype)
     fullname = '%s.%s[]' % (TYPE._namespace, TYPE._classname)
     cliArray = get_cli_class(fullname)
     return SomeOOInstance(cliArray._INSTANCE)
예제 #6
0
파일: dotnet.py 프로젝트: griels/pypy-sc
 def compute_result_annotation(self, type_s, *args_s):
     from pypy.translator.cli.query import get_cli_class
     assert type_s.is_constant()
     TYPE = type_s.const._INSTANCE
     for i, arg_s in enumerate(args_s):
         if TYPE is not arg_s.ootype:
             raise TypeError, 'Wrong type of arg #%d: %s expected, %s found' % \
                   (i, TYPE, arg_s.ootype)
     fullname = '%s.%s[]' % (TYPE._namespace, TYPE._classname)
     cliArray = get_cli_class(fullname)
     return SomeOOInstance(cliArray._INSTANCE)
예제 #7
0
파일: dotnet.py 프로젝트: alkorzt/pypy
 def compute_result_annotation(self, s_value):
     from pypy.translator.cli.query import get_cli_class
     cliType = get_cli_class('System.EventHandler')
     return SomeOOInstance(cliType._INSTANCE)
예제 #8
0
파일: dotnet.py 프로젝트: alkorzt/pypy
 def compute_result_annotation(self, cliClass_s):
     from pypy.translator.cli.query import get_cli_class
     assert cliClass_s.is_constant()
     cliType = get_cli_class('System.Type')
     return SomeOOInstance(cliType._INSTANCE)
예제 #9
0
파일: dotnet.py 프로젝트: griels/pypy-sc
 def compute_result_annotation(self, s_value):
     from pypy.translator.cli.query import get_cli_class
     cliType = get_cli_class('System.EventHandler')
     return SomeOOInstance(cliType._INSTANCE)
예제 #10
0
파일: dotnet.py 프로젝트: griels/pypy-sc
 def compute_result_annotation(self, cliClass_s):
     from pypy.translator.cli.query import get_cli_class
     assert cliClass_s.is_constant()
     cliType = get_cli_class('System.Type')
     return SomeOOInstance(cliType._INSTANCE)
예제 #11
0
def test_array():
    cls = query.get_cli_class('System.Object[]')
    assert cls._INSTANCE._isArray
    assert cls._INSTANCE._ELEMENT is CLR.System.Object._INSTANCE