Ambiguous reference to mediatorMap

Peder's Avatar

Peder

30 Mar, 2011 10:51 AM

Hi

I'm getting 'Ambiguous reference to mediatorMap'. I have baked in @piercer's ViewInterfaceMediatorMap into a context class that my main context class extends. Seems like you solved it her:
http://knowledge.robotlegs.org/discussions/problems/106-pure-as3-mo...

What was the trick?

  1. 1 Posted by Peder on 30 Mar, 2011 11:11 AM

    Peder's Avatar

    Just saw this post which "solved" it
    http://knowledge.robotlegs.org/discussions/questions/80-how-can-i-o...

    I tried to use @piercer's
    override protected function get mediatorMap():IMediatorMap
    {

      return _mediatorMap ||= new ViewInterfaceMediatorMap(contextView, createChildInjector(), reflector);
    

    }

    in a context class that my main context subclassed, but worked if I set the initialization in the constructor

    _mediatorMap = new ViewInterfaceMediatorMap(contextView, createChildInjector(), reflector); super(contextView, autoStartup);

    But would be best if I could overwrite the getter. Any better solutions?

  2. 2 Posted by Abel de Beer on 30 Mar, 2011 02:01 PM

    Abel de Beer's Avatar

    Hey Peder,

    It's a best practice to create a custom Context class which subclasses the default Context. Using the getter override described above would then work as expected.

    • Abel.
  3. 3 Posted by Peder on 30 Mar, 2011 02:09 PM

    Peder's Avatar

    Thx, but that's what I do. It's the same issue as this post
    http://knowledge.robotlegs.org/discussions/questions/80-how-can-i-o...

    I have a custom sub class of SignalContext which overrides the mediatorMap getter, but get 'Ambiguous reference to mediatorMap'.

    Works when I set the value of mediatorMap in constructor. So I can get it to work, but would rather like to override the getter.

  4. 4 Posted by Abel de Beer on 30 Mar, 2011 06:34 PM

    Abel de Beer's Avatar

    This example works for me: https://gist.github.com/894959/ea651dfb640c8d847f48dcfefa4fe4b58497...

    You could try copying the entire code and then testing it...?

  5. Stray closed this discussion on 02 May, 2011 01:17 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac