www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7518] New: Regression(2.058): std.parallelism.parallel fails with shared array of strings

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7518

           Summary: Regression(2.058): std.parallelism.parallel fails with
                    shared array of strings
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: robert octarineparrot.com



15:12:45 GMT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 16 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7518


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha yahoo.com
            Summary|Regression(2.058):          |std.array.empty doesn't
                   |std.parallelism.parallel    |work for shared arrays
                   |fails with shared array of  |
                   |strings                     |



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)[][]))

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 16 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7518


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



19:21:47 PST ---
This reduces to:

bool empty(T)(in T[] a)
{
    return !a.length;
}


void main() {
    shared string[] stuff;
    stuff.empty();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7518




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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 28 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7518


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 28 2012