diff options
author | da-woods <dw-git@d-woods.co.uk> | 2020-12-18 21:47:33 +0000 |
---|---|---|
committer | da-woods <dw-git@d-woods.co.uk> | 2020-12-18 22:00:53 +0000 |
commit | 88fff64595872c3bc840afced689e2da4635778e (patch) | |
tree | ec05bef03af3c3770582281a9c09f73befb648b6 /tests/compile | |
parent | 00001be911cba852f17512fa0056adb2eb88b1e6 (diff) | |
download | cython-88fff64595872c3bc840afced689e2da4635778e.tar.gz |
Fix missing utility code for complex annotations
Generating utility-code for complex types is special-cased, but
it wasn't when they were generated in annotations.
Fixes https://github.com/cython/cython/issues/3949
Diffstat (limited to 'tests/compile')
-rw-r--r-- | tests/compile/complex_annotations.pyx | 7 | ||||
-rw-r--r-- | tests/compile/complex_decorators.pyx | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/compile/complex_annotations.pyx b/tests/compile/complex_annotations.pyx new file mode 100644 index 000000000..5d95611ac --- /dev/null +++ b/tests/compile/complex_annotations.pyx @@ -0,0 +1,7 @@ +# mode: compile + +# Complex numbers defined in annotations weren't having their utility code imported directly +# leading to compile-errors that the type wasn't defined. The test is intentionally minimal since +# anything more thorough ends up creating the utility code +cdef f(x: complex): + pass diff --git a/tests/compile/complex_decorators.pyx b/tests/compile/complex_decorators.pyx new file mode 100644 index 000000000..e8d65244d --- /dev/null +++ b/tests/compile/complex_decorators.pyx @@ -0,0 +1,10 @@ +# mode: compile + +cimport cython + +# Complex numbers defined in "cython.locals" weren't having their utility code imported directly +# leading to compile-errors that the type wasn't defined. The test is intentionally minimal since +# anything more thorough ends up creating the utility code +@cython.locals(x=complex) +cdef f(x): + pass |