Bug 7526 – void functions passed to getopt die

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-02-16T14:36:00Z
Last change time
2014-03-24T10:33:54Z
Assigned to
nobody
Creator
b.helyer

Comments

Comment #0 by b.helyer — 2012-02-16T14:36:29Z
import std.getopt; void usage() {} void main(string[] args) { getopt(args, "help", {usage();}); } This works in 2.057 and Andrei believes it is intended to work.
Comment #1 by lovelydear — 2012-04-20T00:54:51Z
See also issue 7426 and issue 7493
Comment #2 by lovelydear — 2012-04-20T00:57:20Z
(In reply to comment #1) > See also issue 7426 and issue 7493 Oh my, I meant issue 7421 and issue 7693
Comment #3 by andrej.mitrovich — 2014-03-24T10:33:54Z
----- import std.getopt; void usage() { assert(0); } // will throw void main(string[] args) { getopt(args, "help", {usage();}); } ----- Seems to work in 2.064/2.065.