Commit 1b7dd0ba authored by Robert Bradshaw's avatar Robert Bradshaw

Tests e_powop, e_pyobinstruct, e_tempcast, e_while, nogilcmeth now pass.

parent 6f457b91
...@@ -3153,7 +3153,8 @@ class PowNode(NumBinopNode): ...@@ -3153,7 +3153,8 @@ class PowNode(NumBinopNode):
return None return None
def c_types_okay(self, type1, type2): 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): def type_error(self):
if not (self.operand1.type.is_error or self.operand2.type.is_error): if not (self.operand1.type.is_error or self.operand2.type.is_error):
......
cdef object x
cdef struct spam: cdef struct spam:
object parrot object parrot
...@@ -5,5 +7,5 @@ def f(): ...@@ -5,5 +7,5 @@ def f():
cdef spam s cdef spam s
s.parrot = x s.parrot = x
_ERRORS = u""" _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
""" """
cdef object foo, blarg
def foo(obj): def foo(obj):
cdef int *p cdef int *p
p = <int *>blarg # okay p = <int *>blarg # okay
p = <int *>(foo + blarg) # error - temporary p = <int *>(foo + blarg) # error - temporary
_ERRORS = u""" _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
""" """
...@@ -2,7 +2,7 @@ def f(a, b): ...@@ -2,7 +2,7 @@ def f(a, b):
cdef int i cdef int i
break # error break # error
continue # 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:3:1: break statement not inside loop
/Local/Projects/D/Pyrex/Source/Tests/Errors2/e_while.pyx:4:1: continue statement not inside loop /Local/Projects/D/Pyrex/Source/Tests/Errors2/e_while.pyx:4:1: continue statement not inside loop
""" """
cdef class C:
cdef void f(self) nogil
...@@ -3,5 +3,6 @@ cdef class C: ...@@ -3,5 +3,6 @@ cdef class C:
pass pass
_ERRORS = u""" _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
""" """
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment