Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Compilation of generated .c file fails for inline method with fused type #5037

Open
skunkyevil opened this issue Sep 19, 2022 · 0 comments

Comments

@skunkyevil
Copy link

Describe the bug

Getting error C2040 from cl while compiling generated .c file.

Code to reproduce the behaviour:

cimport numpy as cnp

ctypedef fused scalar_or_array:
    long
    cnp.ndarray[long]

cdef class A:
    cdef inline scalar_or_array meth(self, scalar_or_array x):
        return x

If I replace cnp.ndarray[long] with double, I get error C2371 instead of C2040.

I can get rid of error if I make the method not inline. Or if I remove one of types in scalar_or_array definition (any one).

Expected behaviour

I hope inline methods with fused types should work. Or at least provide a clear error description on pyx->c phase.

Environment

OS: Windows 10
Python version 3.9
Cython version 3.0.0a11

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant