[Issue 3854] Error on static initialization of arrays with trailing comma.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 2 04:27:32 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3854



--- Comment #7 from Iain Buclaw <ibuclaw at ubuntu.com> 2010-04-02 04:27:27 PDT ---
(In reply to comment #6)
> (In reply to comment #5)
> > 
> > Attached is a patch that resolves the issue. Am not sure that the patch in the
> > other bug report is reasonably correct, but hey ho!
> > 
> > Regards
> > Iain
> 
> Eh? What makes you think it isn't?

Well, from what I can tell, if I were to have the following code excerpt:

int[] a = [1]];

The scan ahead routine will swallow the "[1]", and since (--brackets == 0),
takes a peek at the last bracket, to which it matches in the if statement and
says 'yep, that is OK'.
In other words, it assumes that whether or not the above line is correct has
already been checked, or will be checked later on during the compile (which I
don't doubt it already has, but at least see it better to have some sort of
sanitisation when checking things).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list