www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6864] New: Const conversion should precedence over the shared one

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

           Summary: Const conversion should precedence over the shared one
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



BasicTypes can convert shared from/to non-shared with copy, but the shared
conversion priority should be lower than const conversions.

This means that following code should pass the assertions.

int fn( const int n) { return 1; }
int fn(shared int n) { return 2; }
inout(int) fw(inout int s) { return 1; }
inout(int) fw(shared inout int s) { return 2; }

int n;
assert(fn(n) == 1);
assert(fw(n) == 1);

shared int sn;
assert(fn(sn) == 2);
assert(fw(sn) == 2);

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


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

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



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

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


Walter Bright <bugzilla digitalmars.com> changed:

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



12:10:56 PDT ---
https://github.com/D-Programming-Language/dmd/commit/3448ffd1b407453aba647da5f0435f648cfbe04f

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