Bug 9441 – struct constructor missed on auto/type-inferred variable definition

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-01T15:28:00Z
Last change time
2013-11-22T01:37:24Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
Marco.Leise
Blocks
340

Comments

Comment #0 by Marco.Leise — 2013-02-01T15:28:13Z
This should compile but doesn't: auto x = X(0.123); struct X { int a; this(double) {} } Error: cannot implicitly convert expression (0.123) of type double to int It works if I reverse the order of declaration for X and x or I don't use type inference for x. E.g. a classical forward reference bug.
Comment #1 by k.hara.pg — 2013-02-02T05:03:28Z
Comment #2 by github-bugzilla — 2013-02-18T18:45:03Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/13235c12fa03ba561b41a172627235698750786e fix Issue 9441 - struct constructor missed on auto/type-inferred variable definition https://github.com/D-Programming-Language/dmd/commit/a02b239102eca0127a2dd784c7fec7534c3c69a0 Merge pull request #1598 from 9rnsr/fix9441 [fwdref bug] Issue 9441 - struct constructor missed on auto/type-inferred variable definition
Comment #3 by Marco.Leise — 2013-02-19T07:21:09Z
Thanks for the quick fix.
Comment #4 by k.hara.pg — 2013-11-22T01:37:24Z
*** Issue 6551 has been marked as a duplicate of this issue. ***