Le 03/05/2014 22:38, Tobias Boege a écrit : > Hi Benoit, > > the compiler seems to ignore "As something" annotations on the LHS of an > assignment. I called them "annotations" but actually I couldn't find any > mention of such a construct in the grammar of expression assignment or LHS > published in the wiki. Look at that code: > > Dim aLetters As String[] = ["a", "b", "c"] ' (1) > > aLetters As String[] = ["d", "e", "f"] ' (2) > aLetters As FMain = ["g", "h", "i"] ' (3) > > In (1), it's totally OK, because "As String[]" is part of the Dim. In (2) > it's strange but it works. aLetters is not redeclared or anything but only > assigned a value. The "As String[]" happens to do nothing but like remind > the programmer of the type of aLetters. > > In (3) it gets totally absurd :-) But it works as if there was nothing. It > should, IMO, raise a compiler error - not because it does nothing or looks > weird but because it is not part of the grammar, apparently. > > I have only found this working in the LHS of an assignment which *includes* > "operating assignments" like +=, &=, etc.. I will definitely have a great > time with that until it gets fixed :-) > > Regards, > Tobi >
It should be fixed in revision #6253. Regards, -- Benoît Minisini ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
