4 Replies Latest reply on May 25, 2009 3:54 AM by Rodo-Adb

    Ambiguous reference - compiler bug?

    HectorHarvey Level 1
      Why does the compiler issue an "Ambiguous reference" error when I assign a property with it's private setter? The compiler error is only issued if the setter is private. If the setter is public... no problem.

      package controller {
      public class MyClass {
      public function MyClass() {
      myObject = new Object(); // Error: Ambiguous reference to myObject.
      }

      private function compileFailure():void {
      myObject = new Object(); // Error: Ambiguous reference to myObject.
      }

      private var _myObject:Object;
      public function get myObject():Object {
      return _myObject; }
      private function set myObject(p:Object):void {
      // I want logic here.
      _myObject = p; }
      }
      }