Thread overview
[Issue 9090] New: auto ref doesn't work with arrays
Nov 28, 2012
Jack Applegame
Dec 07, 2012
Kenji Hara
Dec 07, 2012
dawg@dawgfoto.de
Dec 07, 2012
dawg@dawgfoto.de
Dec 10, 2012
Kenji Hara
November 28, 2012
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


--- Comment #0 from Jack Applegame <japplegame@gmail.com> 2012-11-27 23:18:41 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: -------
December 07, 2012
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


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-12-07 06:37:22 PST ---
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: -------
December 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9090


dawg@dawgfoto.de changed:

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


--- Comment #2 from dawg@dawgfoto.de 2012-12-07 11:34:41 PST ---
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: -------
December 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9090



--- Comment #3 from dawg@dawgfoto.de 2012-12-07 11:42:23 PST ---
(In reply to comment #2)
> 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: -------
December 10, 2012
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


--- Comment #4 from github-bugzilla@puremagic.com 2012-12-07 19:01:04 PST ---
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 Merge pull request #1354 from 9rnsr/fix9090

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: -------