Thread overview
[Issue 8321] New: std.range.put doesn"t work with RefCounted output range
Jun 30, 2012
Kenji Hara
[Issue 8321] std.range.put doesn't work with RefCounted output range
Jun 30, 2012
Kenji Hara
Apr 24, 2013
Kenji Hara
Apr 24, 2013
Kenji Hara
June 30, 2012
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


--- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 2012-06-29 21:44:53 PDT ---
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: -------
June 30, 2012
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


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-06-30 10:18:57 PDT ---
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: -------
July 02, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8321



--- Comment #2 from github-bugzilla@puremagic.com 2012-07-01 21:35:30 PDT ---
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 Merge pull request #656 from 9rnsr/fix8321

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: -------
April 24, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8321



--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2013-04-23 23:57:53 PDT ---
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: -------
April 24, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8321



--- Comment #4 from github-bugzilla@puremagic.com 2013-04-24 03:39:51 PDT ---
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 Merge pull request #1276 from 9rnsr/fix8321

Enable test for issue 8321

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 24, 2013
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: -------