1. No. The "this." should definitely be required in this case. The older compiler was wrong, and we should not continue to propagate the bug. Most likely, ASC 2.0 in the Adobe AIR SDK behaves the same as Falcon, so it would be good if that particular code were treated the same in all modern ActionScript compilers.
2. Yes, I think an error is a good idea. You might also need to allow Class to be allowed in function calls too. I believe "new Example()" is considered a function call. There's a property that says if the function call includes "new". Casting might be considered a function call too. I don't remember. 3. It's probably a good idea. It won't hurt anything, and it will improve compatibility. 4. If you call something that is not a function, Flash Player will throw an exception. TypeError: Error #1006: value is not a function. - Josh On Sun, Aug 21, 2016 at 10:38 PM, Alex Harui <aha...@adobe.com> wrote: > Hi, > > While debugging why some code in the MX/Spark for FlexJS wasn't working, I > saw something like this: > > private function isVertical():Boolean > { > ... > } > > Public function measure():void > { > var isVertical:Boolean = isVertical(); > } > > MXMLC seems to be ok with this. For Falcon, the resolver finds the local > variable (which I think it should) and generates a call to that local > variable which isn't even of type Function, and an exception is thrown at > runtime. No compiler error is reported. > > MXMLC not only doesn't generate an error, it seems to generate a function > call to isVertical() by getting the instance "isVertical". IOW, MXMLC > seems to think the above code is equivalent to: > > public function measure():void > { > var isVertical:Boolean = this.isVertical(); > } > > It seems to me that Falcon is correct. AIUI, local variables should mask > instance variables and require you to use "this." to access the instance > version. > > > So the questions are: > -Should Falcon add logic to resolve "isVertical" to the instance function > in order to be backward-compatible with MXMLC? > -Should Falcon generate an error if there is an attempt to make a function > call on a variable that isn't of type Function, Object or *? > -Should I fix the code in the SDK to add "this." to isVertical()? > -is there supposed to be an exception in resolving for Function calls? > > Thanks, > -Alex > >