Microsoft KB Archive/839284

= BUG: The compiler may not inject the correct pseudo-member array when you overload indexed properties in Visual C++ .NET =

Article ID: 839284

Article Last Modified on 5/18/2007

-

APPLIES TO


 * Microsoft Visual C++ .NET 2003 Standard Edition
 * Microsoft Visual C++ .NET 2002 Standard Edition

-





SYMPTOMS
When you overload indexed properties in Microsoft Visual C++ .NET, the compiler may not inject the correct pseudo-member array.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
The following IntFromChar class declaration contains two overloaded indexed properties: __gc class someClass { public: __property int get_IntFromChar(char*);                   //property 1 __property void set_IntFromChar(char*, int);             //property 1 __property int get_IntFromChar(LPCSTR, int length);  //property 2 __property void set_IntFromChar(LPCSTR, int length, int); //property 2 };

The expected behavior
The complier is supposed to inject two member variables for the IntFromChar class declaration into the someClass class as follows:
 * int IntFromChar[char*];
 * int IntFromChar(LPCSTR, intlength);

The actual behavior
The complier injects only one member variable of type ::

int IntFromChar[char*];

