[Issue 7671] New: Broken inout deduction of shared(inout(T[n])) from immutable(int[3])

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 8 05:44:44 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7671

           Summary: Broken inout deduction of shared(inout(T[n])) from
                    immutable(int[3])
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2012-03-08 05:44:46 PST ---
inout(int)[3]  idn1             ( inout(int)[3] );
       inout( U )[n]  idx1(U, size_t n)( inout( U )[n] );

shared(inout int)[3]  idn2             ( shared(inout int)[3] );
shared(inout  U )[n]  idx2(U, size_t n)( shared(inout  U )[n] );

void main()
{
    pragma(msg, typeof( idn1( (immutable(int)[3]).init ) ));    //
immutable(int[3]), OK
    pragma(msg, typeof( idx1( (immutable(int)[3]).init ) ));    //
immutable(int[3]), OK

    pragma(msg, typeof( idn2( (immutable(int)[3]).init ) ));    //
immutable(int[3]), OK
    pragma(msg, typeof( idx2( (immutable(int)[3]).init ) ));    // Error!
    // test.d(13): Error: template test.idx2(U,uint n) does not match any
function template declaration
}

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


More information about the Digitalmars-d-bugs mailing list