December 10, 2004 ? "Error: one path skips constructor" | ||||
---|---|---|---|---|
| ||||
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 skipping.d # class FancyExceptionClass : Exception{ # this(int type){ # if(type==1){ # super("type 1"); # /* line 5 */ }else if(type==2){ # super("type 2"); # }else{ # /* line 8 */ throw new Exception("unhandled case"); # } # } # } skipping.d(5): Error: one path skips constructor Is this a bug or should I add a dummy super call after line 8? Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFBuen63w+/yD4P9tIRAo8bAJ9mXTmqIb3GQrRqYsiWuUXbs+UF+gCgxR+b rJ7AXV/eRySRbpuzDmQf900= =A61r -----END PGP SIGNATURE----- |
December 11, 2004 Re: ? "Error: one path skips constructor" | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | It's not a bug - the parser does a pretty primitive flow analysis. I'd just add another super call. "Thomas Kuehne" <thomas-dloop@kuehne.thisisspam.cn> wrote in message news:q86p82-1i3.ln1@kuehne.cn... > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > skipping.d > # class FancyExceptionClass : Exception{ > # this(int type){ > # if(type==1){ > # super("type 1"); > # /* line 5 */ }else if(type==2){ > # super("type 2"); > # }else{ > # /* line 8 */ throw new Exception("unhandled case"); > # } > # } > # } > > skipping.d(5): Error: one path skips constructor > > Is this a bug or should I add a dummy super call after line 8? > > Thomas > > > -----BEGIN PGP SIGNATURE----- > > iD8DBQFBuen63w+/yD4P9tIRAo8bAJ9mXTmqIb3GQrRqYsiWuUXbs+UF+gCgxR+b > rJ7AXV/eRySRbpuzDmQf900= > =A61r > -----END PGP SIGNATURE----- |
Copyright © 1999-2021 by the D Language Foundation