Bug 14556 – [REG2.067] can't instantiate struct that has constructor and static array of enum

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-07T22:18:00Z
Last change time
2015-07-21T12:53:49Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
ag0aep6g

Comments

Comment #0 by ag0aep6g — 2015-05-07T22:18:48Z
---- enum E {a = 1} struct OnlyResult { this(E) {} E[1] data; } void main() { auto o = OnlyResult(E.a); /* line 11 */ } ---- Compiles fine with 2.066.1 and older. With 2.067.0 and later: "test.d(11): Error: cannot implicitly convert expression (0) of type int to E[1]" Discovered by Nick Sabalausky in D.learn: http://forum.dlang.org/post/[email protected]
Comment #1 by dlang-bugzilla — 2015-05-08T07:29:27Z
Comment #2 by ag0aep6g — 2015-05-08T22:13:09Z
Same problem with static array of void: ---- struct OnlyResult { this(int) {} void[1] data; } void main() { auto o = OnlyResult(0); } ----
Comment #3 by k.hara.pg — 2015-06-01T11:39:42Z
Comment #4 by github-bugzilla — 2015-06-04T08:58:17Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3cde9f06d19ceb39efb0fcf0febd157b21e2c6b4 fix Issue 14556 - can't instantiate struct that has constructor and static array of enum https://github.com/D-Programming-Language/dmd/commit/920d18e560e9669e6400c5b29c7c40d78b562fdb Merge pull request #4706 from 9rnsr/fix14556 [REG2.067] Issue 14556 - can't instantiate struct that has constructor and static array of enum
Comment #5 by github-bugzilla — 2015-06-17T21:05:37Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3cde9f06d19ceb39efb0fcf0febd157b21e2c6b4 fix Issue 14556 - can't instantiate struct that has constructor and static array of enum https://github.com/D-Programming-Language/dmd/commit/920d18e560e9669e6400c5b29c7c40d78b562fdb Merge pull request #4706 from 9rnsr/fix14556
Comment #6 by code — 2015-07-21T12:53:49Z
*** Issue 14764 has been marked as a duplicate of this issue. ***