Bug 12829 – Wrong error line number for closure allocation in @nogc function

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-31T20:17:00Z
Last change time
2017-08-02T08:07:10Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-05-31T20:17:12Z
void main() @nogc { int x; void delegate() @nogc foo; foo = () { int y = x; }; } DMD 2.066alpha gives a bad line number that doesn't help me locate where the closure is defined or created inside the main function: test.d(1,6): Error: function D main @nogc function allocates a closure with the GC
Comment #1 by bearophile_hugs — 2014-06-02T12:19:16Z
This reports only one closure: void main() @nogc { int x; void delegate() @nogc foo; foo = () { int y = x; }; void delegate() @nogc bar; bar = () { int y = x; }; } test.d(1,6): Error: function D main @nogc function allocates a closure with the GC
Comment #2 by bearophile_hugs — 2015-01-11T18:28:03Z
See also Issue 13967
Comment #3 by k.hara.pg — 2015-08-01T15:41:51Z
Comment #4 by github-bugzilla — 2016-01-31T09:09:34Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a457c8b627123fdb5e6ccf2b130e4d54c1329a56 fix Issue 12829 - Wrong error line number for closure allocation in @nogc function https://github.com/D-Programming-Language/dmd/commit/10a0aa2bda569cb6efbb29f4c9f31aeca9685c46 Merge pull request #4855 from 9rnsr/fix12829 Issue 12829 - Wrong error line number for closure allocation in @nogc function
Comment #5 by github-bugzilla — 2016-03-19T20:21:58Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a457c8b627123fdb5e6ccf2b130e4d54c1329a56 fix Issue 12829 - Wrong error line number for closure allocation in @nogc function https://github.com/D-Programming-Language/dmd/commit/10a0aa2bda569cb6efbb29f4c9f31aeca9685c46 Merge pull request #4855 from 9rnsr/fix12829
Comment #6 by github-bugzilla — 2017-08-02T08:07:10Z
Commit pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/146df2580973de9a3d291be7c747e4ac7c7c2f37 Issue 12829 - Wrong error line number for closure allocation in @nogc function