Commit e6254033 authored by Stefan Behnel's avatar Stefan Behnel

allow diverging nogil declaration, but only when assigning a nogil function to a gil pointer

parent 5c8f0fc0
...@@ -695,7 +695,7 @@ class CFuncType(CType): ...@@ -695,7 +695,7 @@ class CFuncType(CType):
return 0 return 0
if not self.same_calling_convention_as(other_type): if not self.same_calling_convention_as(other_type):
return 0 return 0
if self.nogil != other_type.nogil: if self.nogil and not other_type.nogil:
return 0 return 0
return 1 return 1
......
cdef extern from *: cdef extern from *:
cdef void f() nogil cdef void f()
cdef void (*fp)() cdef void (*fp)() nogil
cdef void g() nogil
cdef void (*gp)()
gp = g
fp = f fp = f
_ERRORS = u""" _ERRORS = u"""
5:6: Cannot assign type 'void (void) nogil' to 'void (*)(void)' 10:6: Cannot assign type 'void (void)' to 'void (*)(void) nogil'
""" """
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