Bug 7929 – Broken semantic of StructInitializer with const

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-16T18:01:00Z
Last change time
2012-04-19T17:03:18Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2012-04-16T18:01:45Z
From d.learn newsgroup: http://forum.dlang.org/thread/[email protected]#post-jmhbk2:24ra2:241:40digitalmars.com struct S { int [] numbers; } void main() { const int [] numbers = new int[2]; const S si = {numbers}; // Error: cannot implicitly convert expression (numbers) of type // const(int[]) to int[] const S se = const(S)(numbers); // OK } This is a bug in processing StructInitializer semantic.
Comment #1 by k.hara.pg — 2012-04-16T18:07:09Z
Comment #2 by github-bugzilla — 2012-04-19T15:59:06Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/849ca3c0a4946a237d30f4a2b860299632d987e7 fix Issue 7929 - Broken semantic of StructInitializer with const https://github.com/D-Programming-Language/dmd/commit/466760e7d817e4276e749c6054cd8a8387f3a437 Merge pull request #884 from 9rnsr/fix7929 Issue 7929 - Broken semantic of StructInitializer with const