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

Issue 2442 - opApply does not allow inferring parameter types when overloaded on const #120

Closed
wants to merge 1 commit into from

Conversation

yebblies
Copy link
Member

Improve opApply type deduction to include function modifier matching, and allow selecting the best match when modifier overloads exist.

This allows you to use type inference in foreach while having different versions of opApply for mutable, const, immutable etc.

http://d.puremagic.com/issues/show_bug.cgi?id=2442

…erloaded on const

Improve opApply type deduction to include function modifier matching, and allow selecting the best match when modifier overloads exist.
@9rnsr
Copy link
Contributor

9rnsr commented Jun 22, 2011

Some of my thoughts.

  1. Ambiguous matching causes incorrect overload resolution [BUG].
    Two or more matchings should cause error, but your code selects incorrect one opApply.
  2. Reduce code duplication
    inferApplyArgTypesY and queryApplyArgTypesY are similar. They should be merged.
  3. More clear test code
    The result of overload resolution is not clear. Set global flag that means which opApply is really selected, and assert it.
    And then, move test code file from compilable to runnable.
  4. Improve code for merging my pull request [important to me]
    Now codes more mergable with dmd/pull/71.

My fixes based on your changes are here.
https://github.com/9rnsr/dmd/commits/fix2442

@yebblies
Copy link
Member Author

I'll comment on the individual commits in your branch.

@WalterBright
Copy link
Member

Superseded by #581

braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
Revert "Revert "Merge pull request dlang#120 from 9rnsr/rvalue-struct-literal""
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.

3 participants