May 31, 2005 Using 'return new int[];' | ||||
---|---|---|---|---|
| ||||
Is this a bug? int[] getStuff() { return new int[]; } If not, maybe it should be added to the spec? This would also be nice: int[] getStuff() { return new int[] [3,2,1,-4]; } |
May 31, 2005 Re: Using 'return new int[];' | ||||
---|---|---|---|---|
| ||||
Posted in reply to D. Trebbien | D. Trebbien wrote: > Is this a bug? > > int[] getStuff() > { > return new int[]; > } Where did you find that code? What do you think it should be instead? > If not, maybe it should be added to the spec? This would also be nice: > > int[] getStuff() > { > return new int[] [3,2,1,-4]; > } Several syntaxes have been proposed for array literals. Including yours, which is syntactically ambiguous. http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/4065 Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
Copyright © 1999-2021 by the D Language Foundation