D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7665 - Problem with fixed-sized associative mutable array key assignment
Summary: Problem with fixed-sized associative mutable array key assignment
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2012-03-07 11:10 UTC by bearophile_hugs
Modified: 2013-11-26 20:40 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 bearophile_hugs 2012-03-07 11:10:20 UTC
Related to bug 7664


void main() {
    enum N = 4;
    char[] A = "hello".dup;
    uint[char[N]] dict;
    dict[*cast(immutable char[4]*)(A[0 .. N].ptr)] = 0; // OK
    dict[A[0 .. N]] = 0; // line 6, error
}


DMD 2.059head gives:

test.d(6): Error: cannot implicitly convert expression (A[0u..4u]) of type char[] to char[4u]