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 -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
