diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2023-04-24 12:48:42 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2023-04-24 18:57:14 +0200 |
commit | d88426829e413ea02780c6502c686de099eb368b (patch) | |
tree | f43df5620d34a1eff9ee51890d8e9316da6661df /tests/errors/pure_errors.py | |
parent | 91b08978873bd49360afeb9d298c874c11cb963e (diff) | |
download | cython-d88426829e413ea02780c6502c686de099eb368b.tar.gz |
Disallow @cfunc being applied to a @ufunc.
Closes https://github.com/cython/cython/issues/5399
Diffstat (limited to 'tests/errors/pure_errors.py')
-rw-r--r-- | tests/errors/pure_errors.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/errors/pure_errors.py b/tests/errors/pure_errors.py index a480d7abe..75682a5a1 100644 --- a/tests/errors/pure_errors.py +++ b/tests/errors/pure_errors.py @@ -68,6 +68,12 @@ def test_contradicting_decorators2(x: object) -> object: return x +@cython.cfunc +@cython.ufunc +def add_one(x: cython.double) -> cython.double: + return x+1 + + _ERRORS = """ 44:22: Calling gil-requiring function not allowed without gil 45:24: Calling gil-requiring function not allowed without gil @@ -75,6 +81,7 @@ _ERRORS = """ 53:0: Exception clause not allowed for function returning Python object 59:0: cfunc and ccall directives cannot be combined 65:0: cfunc and ccall directives cannot be combined +71:0: Cannot apply @cfunc to @ufunc, please reverse the decorators. """ _WARNINGS = """ |