Bug 13879 – Default inizialization of function pointers array

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-20T02:04:00Z
Last change time
2015-01-20T08:30:17Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-12-20T02:04:17Z
The default-inizialization of an array of function pointers has problems: void main() { bool function(int)[2] funcs1 = (int x) => true; // OK funcs1[0] = x => true; // OK bool function(int)[2] funcs2 = x => true; // Error } dmd 2.067alpha gives: test.d(4,36): Error: template lambda has no value
Comment #1 by k.hara.pg — 2015-01-20T03:19:49Z
Comment #2 by github-bugzilla — 2015-01-20T08:30:17Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c15a50653e6a28215367908604ca9baffda68913 fix Issue 13879 - Default inizialization of function pointers array https://github.com/D-Programming-Language/dmd/commit/ec380148a26884f4501341bc3c92f058a7aa0e8f Merge pull request #4315 from 9rnsr/fix13879 Issue 13879 - Default inizialization of function pointers array