View unanswered posts | View active topics



Reply to topic  [ 3 posts ] 
Parameter initializer 
Author Message
Member

Joined: Thu Dec 01, 2011 6:58 am
Posts: 3
I have a error when I compile my project.
This is error message "Parameter initializer unknown or is not a compile-time constant".

And I found this topic from FD's community.
viewtopic.php?f=6&t=3073&p=22799&hilit=Parameter+initializer#p22799

So I think this is Flex SDK's problem.
But I create a simple project like this:
[Main.as]
package
{
import flash.display.Sprite;
public class Main extends Sprite
{
private var g:MyTest;
public function Main():void
{
g = new MyTest();
}
}
}

[MyTest.as]
package
{
public class MyTest
{
private var m_g:int = 0;
public function MyTest(dd:int = TestType.MY_TEST)
{
m_g = dd;
}
}
}

[TestType.as]
package
{
public class TestType
{
public static const MY_TEST:uint = 0;
}
}

Main.as is project entry point.

If I compiler this project first, I will got the error message.
But when I recompile the project,the message disappear!!
(By the way I found this will happen when I switch Debug mode and Release Mode.)

And if I direct use Flex SDK to compile this project.
I never success,always got the error message.

I real want to know what happen?
And why FD not error when compile twice.

Thanks


Wed Jun 06, 2012 2:59 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11724
Location: Paris, France
It's a Flex compiler bug - it doesn't like consts like TestType.MY_TEST for parameters default values


Sat Jun 09, 2012 1:02 pm
Profile WWW
Member

Joined: Thu Mar 27, 2008 2:13 pm
Posts: 208
senocular has a workaround for this

_________________
Was seen using 4.0.4 RTM b2 rev. 2337 on Win7 .NET 2.0 on July 29th, 2012


Mon Jun 11, 2012 9:43 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.