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

Fix Issue 12434 - std.algorithm.sum of immutable array too #2071

Merged
1 commit merged into from Apr 7, 2014
Merged

Fix Issue 12434 - std.algorithm.sum of immutable array too #2071

1 commit merged into from Apr 7, 2014

Conversation

monarchdodra
Copy link
Collaborator

https://d.puremagic.com/issues/show_bug.cgi?id=12434

Simply uses the inference's Unqual type as a seed, rather than the straight up result.

Also add some unittesting while at it.

@Poita
Copy link
Contributor

Poita commented Apr 6, 2014

LGTM

unittest
{
immutable a = [10, 20];
auto s1 = sum(a); // Error
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of context the comments will look weird, I suggest adding // 12434.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry. Yeah, I usually reference the bug number when doing such copy pastes. I guess I forgot this time. Fixed.

https://d.puremagic.com/issues/show_bug.cgi?id=12434

Simply uses the inference's `Unqual` type as a seed, rather than the straight up result.

Also add some unittesting while at it.
@ghost
Copy link

ghost commented Apr 7, 2014

Auto-merge toggled on

ghost pushed a commit that referenced this pull request Apr 7, 2014
Fix Issue 12434 - std.algorithm.sum of immutable array too
@ghost ghost merged commit a3269b7 into dlang:master Apr 7, 2014
@monarchdodra
Copy link
Collaborator Author

Thanks.

@monarchdodra monarchdodra deleted the 12434 branch April 8, 2014 17:21
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants