D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5213 - const/immutable inner structs don't work
Summary: const/immutable inner structs don't work
Status: RESOLVED DUPLICATE of issue 6534
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: 2010-11-13 14:40 UTC by bearophile_hugs
Modified: 2011-12-27 06:26 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 2010-11-13 14:40:22 UTC
This D2 code looks correct:


void main() {
    const struct S1 {}
    immutable struct S2 {}
    static const struct S3 {}
    static immutable struct S4 {}
}


But DMD 2.050 shows the compilation errors:

test.d(2): basic type expected, not struct
test.d(2): no identifier for declarator int
test.d(2): semicolon expected, not 'struct'
test.d(3): basic type expected, not struct
test.d(3): no identifier for declarator int
test.d(3): semicolon expected, not 'struct'
test.d(4): basic type expected, not struct
test.d(4): no identifier for declarator int
test.d(4): semicolon expected, not 'struct'
test.d(5): basic type expected, not struct
test.d(5): no identifier for declarator int
test.d(5): semicolon expected, not 'struct'
Comment 1 Kenji Hara 2011-12-27 06:26:39 UTC

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