Marc Hughes

I am a developer from a bit west of Boston.

Mysterious flex compiler error

22 Aug 2007

1119: Access of possibly undefined property someOtherMember through a reference with static type SecondClass ...

Sometimes, the flex compiler just decides to start throwing this error around. It's usually on a line such as:

SomeClass.someMember.someOtherMember = "Hi";

With some simple definitions like...

class SomeClass
public static var someMember:SecondClass;

class SecondClass
public var someOtherMember:String;

A clean-build will often make the reported error go away. But sometimes it won't. The error will start happening at seemingly random times when I've been working on completely unrelated sections of the code. One compile everything is fine, then the next it just starts complaining when nothing related was changed.

It happens in FB2, FB3 (using the FB2 SDK), and when compiling from the command line using the FB2 SDK. I haven't seen it using the FB3 SDK, but that doesn't help me since it happens fairly infrequently.

This is a compile-time error, not a run-time error, so it has nothing to do with variables not being initialized. There's no other errors (or even warnings for that matter) in the project.