Hello,I'm using Visual Studio 2010 and .NET4.0.I have the following classes defined in a dll (simplification of my real code):namespace test { interface class I { property bool IsOk { bool get(); } }; public ref class A abstract : I { private: virtual property bool IsFine { bool get() sealed = I::IsOk::get { return false; } } }; //OK public ref class B : public A { };}The code compiles. But if I define a new class deriving from A in another dll or exe ref class C : public test::A{}; I get some compilation warnings and errors which do not make any senses to me: * error C3766: 'C' must provide an implementation for the interface method 'bool test::I::IsOk::get(void)' see declaration of 'test::I::IsOk::get' * warning C4570: 'C' : is not explicitly declared as abstract but has abstract functions 'bool test::I::IsOk::get(void)' : is abstract see declaration of 'test::I::IsOk::get' * error C2259: 'C' : cannot instantiate abstract class due to following members: 'bool test::I::IsOk::get(void)' : is abstract deleteme3.cpp(36) : see declaration of 'test::I::IsOk::get' There are no differences between the classes 'B' and 'C'.If now I define the same class 'C' in a C# project, I have no compilation error or warnings. I have checked the IL for the class A:.method private hidebysig newslot specialname virtual final instance bool marshal( unsigned int8) get_IsFine() cil managed{ .override test.I::get_IsOk // Code size 4 (0x4) .maxstack 1 .locals ([0] bool V_0) IL_0000: ldc.i4.0 IL_0001: stloc.0 IL_0002: ldloc.0 IL_0003: ret} // end of method A::get_IsFineI can see the override information. I wonder if the compiler simply ignore this information when it reads my reference, or do I miss something in my code? Regards,Richard
Visual Studio/Silverlight/Tooling version
What category (if any) best represents this feedback?
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results
Please wait...