[mtasc] Bug? static variable vs. package name vs. ambigous class
name
futsuk at gmx.net
futsuk at gmx.net
Mon Oct 10 13:51:11 CEST 2005
Hi all,
I have found was I believe to be a bug in mtasc.
I use version 1.10.
This bug appears when a class imports a package and has a static variable
by the same name and then uses an ambigous class.
Example:
Suppose there are two packages, letter and photo.
Each package contains a class ResultScreen.
Now consider the following code:
import letter.*;
import photo.*;
class BugTest {
static var letter:BugTest;
static var photo:BugTest;
static function myFunc():Void {
var r:ResultScreen = new ResultScreen();
}
}
There are several difficulties with this code:
1) Since both letter and photo contain a class ResultScreen, the type
ResultScreen is ambigous.
2) Since there is a package letter and a static variable letter, the
expression letter.ResultScreen would be ambigous
If this code is compiled with the Macromedia Compiler, it throws the
following error message:
**Error** BugTest.as: Line 13: There is no method with the name 'ResultScreen'.
var r:ResultScreen = new ResultScreen();
If this code is compiled with MTASC, it finishes compilation without errors.
Under some circumstance (sorry, couldn't figure out which) this special
situation causes MTASC to compile incorrectly.
That is, an SWF is produced without compilation errors, but when playing
this SWF, execution of AS simply stops at some point without explaination.
I know this is a rather inprecise bug report, but maybe it might lead
someone with knowledge of the MTASC source to a possible problem.
cheers,
Kris
More information about the mtasc
mailing list