The following code: ---- import std.parallelism; shared string[] options; void main() { foreach(option; parallel(options)) { } } ---- Worked with dmd 2.057 but fails with dmd 2.058, with the errors: ---- /Users/robert/.dvm/compilers/dmd-2.058/bin/../src/phobos/std/parallelism.d(3858): Error: template std.array.empty(T) does not match any function template declaration /Users/robert/.dvm/compilers/dmd-2.058/bin/../src/phobos/std/parallelism.d(3858): Error: template std.array.empty(T) cannot deduce template function from argument types !()(shared(immutable(char)[][])) ---- Tested on OS X and Linux.
The root cause has nothing to do with std.parallelism. empty() should work for shared arrays. import std.array; void main() { shared string[] stuff; stuff.empty; } test.d(5): Error: template std.array.empty(T) does not match any function template declaration test.d(5): Error: template std.array.empty(T) cannot deduce template function from argument types !()(shared(immutable(char)[][]))
This reduces to: bool empty(T)(in T[] a) { return !a.length; } void main() { shared string[] stuff; stuff.empty(); }
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/224fb68cb3fc16f5ad0e2caaae3ad0623c06b04c fix Issue 7518 - std.array.empty doesn't work for shared arrays