Ambiguous reference bug for namespaces in Flex

by Ruben

Before coming up with a solution for binding read-only accessors a few months ago, I had already tried out various alternatives, among which the following (which was later also pointed out by others through the comments):

// public getter:
public function get someProperty ():String {
  return this._someProperty;
// protected setter:
protected function set someProperty (value:String):void {
  this._someProperty = value;

However, the problem here was that Flex throws an error saying "1000: Ambiguous reference to someProperty" whenever you try to use the setter.

After reading a post by Adam Flater I decided to start looking through the documentation and found out that this is in fact a known compiler bug:

174646: If a class contains accessor functions with different access control namespace attributes, (for example, aprotected setter and a public getter) using one of them causes a compile-time-error, for example,Compiler-Error 1000: Ambiguous reference to myVar
The workaround is to rename your getter or setter function to avoid the mismatch.
Common Flex 2 compiler errors and known issues

This bug doesn't seem to have been fixed in any of the Flex 2 hotfixes, and neither in the Flex 3 Beta (thanks to Wietse for testing). Let's hope the folks over at Adobe are going to do something about it..