[mtasc] Deprecated keyword issue
iiley
iiley.chen at gmail.com
Fri Jun 24 06:10:02 CEST 2005
Hello, there was my two test class:
class test.AddVarTest{
public var add:Number;
public function AddVarTest(){
this.add = 3; //works ok here
//add = 3; //without this. MTASC will accour : type error You
cannot use a deprecated keyword as a variable name
}
public static function main():Void{
var t:AddVarTest = new AddVarTest();
Flashout.log("add = " + t.add); //output "add = 3"
}
}
class test.AddFuncTest{
private var number:Number;
public function AddFuncTest(){
number = 0;
}
public function add(n:Number):Void{
number += n;
}
public function addFive():Void{
this.add(5); // works fine
//add(5); // MTASC occour : type error You cannot use a deprecated
keyword as a variable name
}
public function logNumber():Void{
Flashout.log("number = " + number);
}
public static function main():Void{
var t:AddFuncTest = new AddFuncTest();
t.addFive();
t.add(5); //works fine
t.logNumber(); // output "number = 10"
}
}
With these comments in the two classes, you can see that i can use
deprecated keyword "add" to be a class field, can be a member method
name and member variable, but if you want to call them, you only can
call it start with "this." in class, but other normal class field you
can call them both directly and start with "this".
My issue is : i very really want to have a method named "add", you
know this word is a very good and customary method name. In AsWing
project, there was alot of methods named "add" (same as java swing),
these are important methods, it works before MTASC1.06. But now it get
error after MTASC1.07, I can hardly to find another good name to
replace it.
My suggestion is : can we accept deprecated keyword like "add" to be a
legit variable name or just get warning of it?
More information about the mtasc
mailing list