Bug 11661 – Meaningless error: "a struct is not a valid initializer for a void function()"

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-01T18:09:00Z
Last change time
2013-12-02T17:11:08Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2013-12-01T18:09:48Z
This code should work, but doesn't. void main() { void delegate() dg = {}; // OK void function() fp = {}; // NG } test.d(4): Error: a struct is not a valid initializer for a void function()
Comment #1 by k.hara.pg — 2013-12-01T18:12:50Z
Comment #2 by github-bugzilla — 2013-12-02T09:56:48Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ad2ca4bf5f46d36e7eab1784572c67ed24d7cec7 fix Issue 11661 - Meaningless error: "a struct is not a valid initializer for a void function()" https://github.com/D-Programming-Language/dmd/commit/12f40d54329c41797316d8bcbfcb92750498e233 Merge pull request #2909 from 9rnsr/fix11661 Issue 11661 - Meaningless error: "a struct is not a valid initializer for a void function()"