www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Synchronized methods in D2

I'm currently porting a D1 code base to D2 which has the following class 
hierarchy:

interface Map
{
      void clear ();
}

class Hashtable : Map
{
     synchronized void clear () {};
}

class HashMap : Map
{
     void clear () {};
}

When I compiler the code I get an error about the "clear" method in 
Hashtable not being covariant with the "clear" method in Map. Any 
suggestions how I could solve this, preferable working in D1 as well?

-- 
/Jacob Carlborg
Sep 04 2010