----- import std.getopt; void main(string[] args) { int i; getopt(args, &i); } ----- std\getopt.d(392): Error: array index [1] is outside array bounds [0 .. 1] std\getopt.d(401): Error: string slice [2 .. 1] is out of bounds std\getopt.d(401): Error: cannot return non-void from void function std\getopt.d(351): Error: template instance std.getopt.getoptImpl!(int*) error instantiating I think we can fix this easily: before: void getopt(T...)(ref string[] args, T opts) { after: void getopt(T...)(ref string[] args, T opts) if (T.length > 1) {
https://github.com/D-Programming-Language/phobos/pull/1542
closed by https://github.com/D-Programming-Language/phobos/pull/3859