D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11083 - Whole global matrix initialization
Summary: Whole global matrix initialization
Status: RESOLVED DUPLICATE of issue 8979
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2013-09-21 05:34 UTC by bearophile_hugs
Modified: 2020-03-21 03:56 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 2013-09-21 05:34:08 UTC
I am not sure if this is an enhancement request, but I'd like to initialized the whole module-level 'a' to a given value:


double[2][2] a = 0.0; // error
void main() {
    double[2][2] b = 0.0; // OK
}
Comment 1 Andrej Mitrovic 2013-09-21 05:54:13 UTC
(In reply to comment #0)
> double[2][2] a = 0.0; // error

I think it's actually just a bug that it's not accepted. Workaround:

double[2][2] a = [0.0];
Comment 2 basile-z 2019-07-23 00:58:06 UTC

*** This issue has been marked as a duplicate of issue 8979 ***