[pypy-svn] r51927 - in pypy/dist/pypy/translator/cli: . test

antocuni at codespeak.net antocuni at codespeak.net
Thu Feb 28 20:40:49 CET 2008


Author: antocuni
Date: Thu Feb 28 20:40:46 2008
New Revision: 51927

Modified:
   pypy/dist/pypy/translator/cli/dotnet.py
   pypy/dist/pypy/translator/cli/test/test_dotnet.py
Log:
make sure we can compare the result of classof()



Modified: pypy/dist/pypy/translator/cli/dotnet.py
==============================================================================
--- pypy/dist/pypy/translator/cli/dotnet.py	(original)
+++ pypy/dist/pypy/translator/cli/dotnet.py	Thu Feb 28 20:40:46 2008
@@ -564,7 +564,7 @@
 def classof(cliClass):
     assert isinstance(cliClass, CliClass)
     TYPE = cliClass._INSTANCE
-    return ootype._class(TYPE)
+    return ootype.runtimeClass(TYPE)
 
 class Entry(ExtRegistryEntry):
     _about_ = typeof

Modified: pypy/dist/pypy/translator/cli/test/test_dotnet.py
==============================================================================
--- pypy/dist/pypy/translator/cli/test/test_dotnet.py	(original)
+++ pypy/dist/pypy/translator/cli/test/test_dotnet.py	Thu Feb 28 20:40:46 2008
@@ -612,6 +612,13 @@
             return int32_type.get_Name()
         assert self.interpret(fn, []) == 'Int32'
 
+    def test_classof_compare(self):
+        int32_a = classof(System.Int32)
+        int32_b = classof(System.Int32)
+        def fn():
+            return int32_a is int32_b
+        assert self.interpret(fn, [])
+
 class TestPythonnet(TestDotnetRtyping):
     # don't interpreter functions but execute them directly through pythonnet
     def interpret(self, f, args, backendopt='ignored'):



More information about the Pypy-commit mailing list