Tests e_powop, e_pyobinstruct, e_tempcast, e_while, nogilcmeth now pass.
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 11 Jun 2008 22:31:13 +0000 (15:31 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 11 Jun 2008 22:31:13 +0000 (15:31 -0700)
Cython/Compiler/ExprNodes.py
tests/errors/e_pyobinstruct.pyx
tests/errors/e_tempcast.pyx
tests/errors/e_while.pyx
tests/errors/nogilcmeth.pxd [new file with mode: 0644]
tests/errors/nogilcmeth.pyx

index d4f0ff249ebd228739191399d425746f2f7004e6..976af1ce67094ea48bdf1dd75a7a1ed75e60b125 100644 (file)
@@ -3153,7 +3153,8 @@ class PowNode(NumBinopNode):
             return None
 
     def c_types_okay(self, type1, type2):
-        return type1.is_float or type2.is_float
+        return (type1.is_float or type2.is_float) and \
+                NumBinopNode.c_types_okay(self, type1, type2)
 
     def type_error(self):
         if not (self.operand1.type.is_error or self.operand2.type.is_error):
index fd7e951343018125c623811da68557fd023d8809..f52b79782fe4e7bdfd2579e7a67b94d80793425b 100644 (file)
@@ -1,3 +1,5 @@
+cdef object x
+
 cdef struct spam:
        object parrot
 
@@ -5,5 +7,5 @@ def f():
        cdef spam s
        s.parrot = x
 _ERRORS = u"""
-/Local/Projects/D/Pyrex/Source/Tests/Errors1/e_pyobinstruct.pyx:2:8: C struct/union member cannot be a Python object
+/Local/Projects/D/Pyrex/Source/Tests/Errors1/e_pyobinstruct.pyx:4:8: C struct/union member cannot be a Python object
 """
index 5694b675c886656fdec6f2d181eba87ee66eddc2..dd6b2c9ccc4360597bb3c4771b61788d0f71777e 100644 (file)
@@ -1,7 +1,9 @@
+cdef object foo, blarg
+
 def foo(obj):
        cdef int *p
        p = <int *>blarg # okay
        p = <int *>(foo + blarg) # error - temporary
 _ERRORS = u"""
-/Local/Projects/D/Pyrex/Source/Tests/Errors1/e_tempcast.pyx:4:5: Casting temporary Python object to non-Python type
+/Local/Projects/D/Pyrex/Source/Tests/Errors1/e_tempcast.pyx:6:5: Casting temporary Python object to non-numeric non-Python type
 """
index aafcf9a10326ddb7977e25610f8023d5f9205967..6b4bfa4c19fa169bbdb98f2395c6a2dd6331ce26 100644 (file)
@@ -2,7 +2,7 @@ def f(a, b):
        cdef int i
        break # error
        continue # error
-       _ERRORS = u"""
+_ERRORS = u"""
 /Local/Projects/D/Pyrex/Source/Tests/Errors2/e_while.pyx:3:1: break statement not inside loop
 /Local/Projects/D/Pyrex/Source/Tests/Errors2/e_while.pyx:4:1: continue statement not inside loop
 """
diff --git a/tests/errors/nogilcmeth.pxd b/tests/errors/nogilcmeth.pxd
new file mode 100644 (file)
index 0000000..5d34090
--- /dev/null
@@ -0,0 +1,2 @@
+cdef class C:
+    cdef void f(self) nogil
index 536be3b0e25d03c4c115b9b0fd56a3163d1e6fa0..f480da07331efe1840e91d3ae9e355c83886ad1b 100644 (file)
@@ -3,5 +3,6 @@ cdef class C:
         pass
 
 _ERRORS = u"""
-2:6: Signature does not match previous declaration
+nogilcmeth.pyx:2:9: Signature not compatible with previous declaration
+nogilcmeth.pxd:2:15: Previous declaration is here
 """