Something goes wrong with range and sort?

Brad Anderson eco at gnuk.net
Fri Jun 14 10:34:43 PDT 2013


On Friday, 14 June 2013 at 10:07:13 UTC, Andrea Fontana wrote:
>
> 	string[] test_filter(string[] words)
> 	{
> 		static blackList =
> 		[
> 			"d", "c", "e", "a", "è", "é", "e"
> 		].sort();
> 		
> 		return words.filter!((a) => 
> !blackList.assumeSorted.contains(a)).array;
> 	}
>
> 	test_filter(["a", "b", "test", "hello"]).writeln;
>
>
> This code crash! It's just a useless trimmed-down version of a 
> more complex code, just to show you the bug.
>
> If you remove accented letters from "blacklist" array it works 
> fine. Why?

I'm not seeing a crash here: http://dpaste.dzfl.pl/59d5fb36

What version of the compiler/phobos are you using?


More information about the Digitalmars-d mailing list