error CS0229: Ambiguity between 'XX.Name' and 'YY.Name'
I tried to implement the following scenario in VC++ 2005 beta2: an object implements 2 interfaces, one defining a property get and the other defining a property set.
This works perfectly well when implemented in C#. However, in C++, I get the compiler error message transcripted below.
Here is the C++ source code:
namespace NS
{
public interface class INamed
{
public:
property String^ Name
{
String^ get();
}
};
public interface class INameable
{
public:
property String^ Name
{
void set(String^);
}
};
public ref class NamedObject : public INamed, public INameable
{
private:
String^ m_name;
public:
property String^ Name
{
virtual String^ get() = INamed::Name::get
{
return m_name;
}
virtual void set(String^ value) = INameable::Name::set
{
m_name = value;
}
}
};
}
When I try to use my object in a C# program:
{
NamedObject o = new NamedObject();
String name = o.Name;
}
I get the following compiler error:
error CS0229: Ambiguity between 'NS.INamed.Name' and 'NS.INameable.Name'
There should be no ambiguity since there is only one get and one set (and, as I mentionned before, the same code works in C#).
Is there anything wrong with my code (I hope so !).
Chris.

