D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7671 - Broken inout deduction of shared(inout(T[n])) from immutable(int[3])
Summary: Broken inout deduction of shared(inout(T[n])) from immutable(int[3])
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2012-03-08 05:44 UTC by Kenji Hara
Modified: 2012-03-11 15:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2012-03-08 05:44:46 UTC
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
}