(In reply to Steven Schveighoffer from comment #3)
> Seems to be fixed in latest head. Not sure where it was fixed, possibly here:
>
> https://github.com/D-Programming-Language/phobos/pull/3669
Yes, it is. As far as I see, the `uniform` and `text` functions are not nothrow, then dbgVerifySorted was also inferred to throwable.
Comment #5 by b2.temp — 2015-11-08T08:35:15Z
it looks like it was not fully fixed, still with -debug:
---
import std.algorithm, std.container;
void main()
{
static bool compare(P a, P b)
{
return a.curColumn < b.curColumn;
}
Array!P a = make!(Array!P);
sort!compare(a[]);
}
struct P
{
int curColumn = 0;
}
---
see http://forum.dlang.org/post/[email protected]
Comment #6 by tobias — 2015-11-08T09:19:54Z
Making dbgVerifySorted a template function fixes this instance. Probably because the compiler will infer it is nothrow.
Comment #7 by schveiguy — 2015-11-08T17:10:38Z
dbgVerifySorted is part of a SortedRange, which is a template. member functions of templates are also allowed to be inferred using the compiler.
This is why dbgVerifySorted was fixed in PR by the removal of the RNG (and not adding nothrow specifically).
Either this is a compiler bug or somehow the comparison function isn't implied to be nothrow.
Note that there's no 'nothrow' in your code, which makes me feel like the compiler is outsmarting itself.
I think this is a new bug. Please open a new one, as the original regression was fixed.
Comment #8 by b2.temp — 2015-11-09T00:29:41Z
(In reply to Steven Schveighoffer from comment #7)
> dbgVerifySorted is part of a SortedRange, which is a template. member
> functions of templates are also allowed to be inferred using the compiler.
>
> This is why dbgVerifySorted was fixed in PR by the removal of the RNG (and
> not adding nothrow specifically).
>
> Either this is a compiler bug or somehow the comparison function isn't
> implied to be nothrow.
>
> Note that there's no 'nothrow' in your code, which makes me feel like the
> compiler is outsmarting itself.
>
> I think this is a new bug. Please open a new one, as the original regression
> was fixed.
https://issues.dlang.org/show_bug.cgi?id=15304