Skip to content

Fix Issue 17982 - Support for const(Class) in algorithm.searching.extremum#6157

Merged
dlang-bot merged 1 commit intodlang:masterfrom
wilzbach:fix-17982
Apr 5, 2018
Merged

Fix Issue 17982 - Support for const(Class) in algorithm.searching.extremum#6157
dlang-bot merged 1 commit intodlang:masterfrom
wilzbach:fix-17982

Conversation

@wilzbach
Copy link
Copy Markdown
Contributor

No description provided.

@dlang-bot
Copy link
Copy Markdown
Contributor

dlang-bot commented Feb 11, 2018

Thanks for your pull request, @wilzbach!

Bugzilla references

Auto-close Bugzilla Severity Description
17982 normal Support for const(Class) in algorithm.searching.extremum

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + phobos#6157"


const(B)[] arr = [new B(0), new B(1)];
// can't compare directly - https://issues.dlang.org/show_bug.cgi?id=1824
assert(arr.extremum!"a.val".val == 0);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Imho this is the real bummer - arr.extremum!"a.val" == new B(0) doesn't work :/

int val;
}

import std.stdio;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove

this(int val){ this.val = val; }
}

const(B) doStuff(const(B)[] v)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is never called

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It doesn't need to be called (it's a copy from the bug report).
Anyhow, I added an call of doStuff for "more coverage".

@wilzbach wilzbach added the Merge:72h no objection -> merge The PR will be merged if there are no objections raised. label Apr 2, 2018
@wilzbach wilzbach added this to the 2.080.0 milestone Apr 2, 2018
@dlang-bot dlang-bot merged commit 193c61d into dlang:master Apr 5, 2018
@wilzbach wilzbach deleted the fix-17982 branch April 5, 2018 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merge:auto-merge Merge:72h no objection -> merge The PR will be merged if there are no objections raised. Severity:Bug Fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants