Thread overview
[Issue 6872] New: Breaking type parsing of shared(inout(int)[])
Nov 01, 2011
Kenji Hara
Nov 24, 2011
Kenji Hara
Dec 11, 2011
Kenji Hara
Dec 11, 2011
Walter Bright
November 01, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6872

           Summary: Breaking type parsing of shared(inout(int)[])
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-01 04:59:19 PDT ---
Code:
inout(int) func(shared(inout(int)[]) arr){ return 0; }

Output:
test.d(1): Error: inout on return means inout must be on a parameter as well
for inout(int)(shared(shared(const(int))[]) arr)

The shared(inout(int)[]) type is parsed as shared(shared(const(int))[]), it is
incorrect.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6872


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-24 13:54:14 PST ---
https://github.com/D-Programming-Language/dmd/pull/486

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 11, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6872



--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-12-11 03:38:49 PST ---
Following cases are also rejected.

static assert((shared(inout(const(int)[]))).stringof
           == "shared(inout(const(int)[]))");
static assert((shared(inout(const(int)[])[])).stringof
           == "shared(inout(const(int)[])[])");
static assert((shared(inout(const(immutable(int)[])[])[])).stringof
           == "shared(inout(const(immutable(int)[])[])[])");

The TypeNext::makeXXX() functions should convert the modifier of new next type
object like Type::addMod() function.

Updated patch and splitted pull request from #486. https://github.com/D-Programming-Language/dmd/pull/555

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 11, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6872


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-12-11 11:16:06 PST ---
https://github.com/D-Programming-Language/dmd/commit/d199900617121a5a6381b05e55c07ca14ad8f582

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