www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8321] New: std.range.put doesn"t work with RefCounted output range

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

           Summary: std.range.put doesn"t work with RefCounted output
                    range
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



Test case:
----
import std.typecons, std.range;
struct S {
    void put(int[] a){}
    void put(int   n){}
}
void main() {
    S s;
    put(s,  1);     // OK
    put(s, [1]);    // OK

    auto rs = RefCounted!S();
    put(rs,  1);    // doesn't work
    put(rs, [1]);   // doesn't work
}
----

To fix this issue, both Phobos and dmd needs to be fixed.
- std.traits.hasMembers doesn't see the members through alias this.
- There is no way to check whether a type T has a member xxx or not, while
avoiding UFCS.

I've conceived following technique, but doesn't work with current dmd.

struct T { void put(){} }
alias T.put X;   // Type.member doesn't test UFCS,
                 // but getting symbol of xxx would work!
struct S { T t; alias t this; }
alias S.put X;   // Getting symbol through alias this doesn't work...

I think we need to fix bug 4617.

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
          Component|DMD                         |Phobos
         Depends on|                            |4617
            Summary|std.range.put doesn"t work  |std.range.put doesn't work
                   |with RefCounted output      |with RefCounted output
                   |range                       |range



https://github.com/D-Programming-Language/phobos/pull/656

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




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/2a1012a1464a17e0242b773e6cc62a6c5fac9c69
fix Issue 8321 - std.range.put doesn't work with RefCounted output range

https://github.com/D-Programming-Language/phobos/commit/190a7be000eac31d1e6fe9c9aeaca3c55fa4dd30


Issue 8321 - std.range.put doesn't work with RefCounted output range

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




Pull request to enable unittest.

https://github.com/D-Programming-Language/phobos/pull/1276

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 23 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8321




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/9e178000a4ec793a7c8dcf6bf381d6a70febbf39
Enable test for issue 8321

https://github.com/D-Programming-Language/phobos/commit/2d33fe346db8efdff276155ba188650d08308667


Enable test for issue 8321

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 24 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8321


Kenji Hara <k.hara.pg gmail.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: -------
Apr 24 2013