Mark

the getAccount isn't a getter method, try this get Account():String { return
"bla"};


Regards

Igor Costa

On 2/22/07, Mark Piller <[EMAIL PROTECTED]> wrote:

  We ran into something that looks like a compiler bug. Please take a
look at the code below and correct me if I am wrong. The object model
and the class names of the code below may not make any sense, I put it
together to demonstrate the problem.

Here's a class with a static property:

package
{
public class StaticClass
{
public static function get Account():String
{
return "my account name";
}
}
}

Here's a class inheriting from the class shown above:

package
{
public class NonStaticClass extends StaticClass
{
public var _parentAccount:Account;

public function NonStaticClass()
{
_parentAccount = new Account();
}
}
}

And finally the Account class used in the NonStaticClass:

package
{
public class Account
{
public var name:String;
}
}

The compiler reports two problems with the code. Both in the
NonStaticClass:

1. "Type was not found or was not a compile-time constant: Account."
This one shows up for the _parentAccount field declaration

2 "Call to a possibly undefined method Account"
This error shows up for the initialization of the _parentAccount field
in the NonStaticClass constructor.

It looks like there are two problems in the compiler:
1. Compiler attempts to inherit static declarations
2. As a result of (1), the compiler gets confused between the static
property and a class type

Cheers,
Mark




--
----------------------------
Igor Costa
www.igorcosta.org
www.igorcosta.com
skype: igorpcosta

Reply via email to