www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9090] New: auto ref doesn't work with arrays

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

           Summary: auto ref doesn't work with arrays
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: japplegame gmail.com



PST ---
void test1(T)(auto ref const T[] val) {}
void main() {
  string a;
  test1(a);
}

Output:
Error: cast(const(char[]))a is not an lvalue

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid



https://github.com/D-Programming-Language/dmd/pull/1354

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


dawg dawgfoto.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dawg dawgfoto.de



This also happens with ref and plain types.

----
void test1(ref const char[] val) {}
void main() {
    string a;
    test1(a);
}
----
void test1(ref const(char) val) {}
void main() {
    immutable char a;
    test1(a);
}
----

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





 This also happens with ref and plain types.
Does an implicit const cast means to become an rvalue. But still auto ref and implicit const cast doesn't work for integral types too. void test1()(auto ref const char val) {} void main() { immutable char a; test1(a); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 07 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9090


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

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



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

https://github.com/D-Programming-Language/dmd/commit/03e88e1a731dd941dad4861134e8568abe54ab1b
fix Issue 9090 - auto ref doesn't work with arrays

https://github.com/D-Programming-Language/dmd/commit/3302a4b852772d24c0735419a35cba0b754100aa


Issue 9090 - auto ref doesn't work with arrays

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