www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - assumeSorted can't access private function when compiling with -debug

Here's code:


private {
     import std.algorithm;
     import std.range;
     import std.typecons;
     alias Tuple!(int, string) Data;
}

private bool myCmp(Data a, Data b) {
     return a[0] < b[0];
}

auto bar() {
     return [Data(1, "one"), Data(2, "two")].assumeSorted!myCmp;
}

void main()
{
     bar();
}

Build it with -debug and without. It gives me error when building 
with -debug.

/usr/include/dmd/phobos/std/algorithm/sorting.d(154): Error: 
function sorttest.myCmp is not accessible from module sorting

Is it bug?
Jan 09