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

fused types: specialize each base type only once, also for compound type args #284

Merged
merged 1 commit into from Jun 22, 2014

Conversation

pv
Copy link
Contributor

@pv pv commented Mar 22, 2014

This PR removes the cross-product expansion of memoryview fused type args,
and expands permutations only over non-compound fused types. (And also fixes a signature resolution bug, triggered by the second test case added.)

I also make the corresponding change in cpdef signature resolution. The signatures now contain only the base fused types. The signature lookup determines the signature based on the leftmost types.

The case where more than one fused type is contained in a compound type is not handled
in the signature resolution, raises a compiler error. I don't think that this case can currently
happen, however, as it doesn't seem currently possible to typedef structs containing fused
types.

This is a behavior change, as cross-product specializations are no longer generated for
memoryview arguments. However, as discussed on the list, I believe the cross-product expansion is not the correct thing to do, as it creates ambiguities on the meaning of the expanded fused types in the function body.

…ype args

Make also the corresponding change in cpdef signature resolution.

This is a behavior change, as cross-product specializations are no
longer generated for memoryview arguments.
@scoder
Copy link
Contributor

scoder commented Jun 22, 2014

Thanks for writing this up, looks good to me. This should go into 0.21 in one way or another, so I'll just merge it and see if there is anything further to do about it later.

scoder added a commit that referenced this pull request Jun 22, 2014
fused types: specialize each base type only once, also for compound type args
@scoder scoder merged commit 4228dfd into cython:master Jun 22, 2014
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

Successfully merging this pull request may close these issues.

None yet

2 participants