PDA

View Full Version : Intermittent Mystery Warning with Namespaces


chriswa
10-08-2008, 06:06 AM
I'm using FlashDevelop 3B7 and am getting an intermittent warning now that I've come up with a good use for namespaces:

...\as3-platformer-game\src\platformer\actor\Actor.as(37): col: 59 Warning: void used where a Boolean value was expected. The expression will be type coerced to Boolean.

I start off with a member variable using a custom namespace "Manager":

Manager var _isAlive:Boolean = true;

And the sometimes-offending code is:

public function get isAlive():Boolean { return Manager::_isAlive; }

If I "Rebuild Classpath Cache" the warning goes away... that is, until I make any kind of change at all to Actor.as.

I'm not sure if this is a FlashDevelop or AS3 compiler issue. Has anyone run into this before?

chriswa
10-08-2008, 06:09 AM
It turns out that if I change that line to the following, the problem disappears entirely:

public function get isAlive():Boolean { use namespace Manager; return _isAlive; }

I guess I'll just do that instead... :confused: