D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 12819 - Refused purity conversion of immutable array of arrays
Summary: Refused purity conversion of immutable array of arrays
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2014-05-29 12:30 UTC by bearophile_hugs
Modified: 2024-12-13 18:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2014-05-29 12:30:31 UTC
I am not sure, but perhaps both functions should compile:


immutable(string)[] foo() pure {
    char[][] a;
    return a; // OK
}
string[] bar() pure {
    char[][] b;
    return b; // Error
}
void main() {}


DMD 2.066alpha gives:

test.d(7,12): Error: cannot implicitly convert expression (b) of type char[][] to string[]
Comment 1 dlangBugzillaToGithub 2024-12-13 18:21:10 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17662

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB