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



The information in this article applies to:

  • Microsoft Visual C++ .NET (2003)
  • Microsoft Visual C++ .NET (2002)

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 "Applies to" 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::

int IntFromChar[char*];

REFERENCES

For additional information about indexed properties, visit the following Microsoft Developer (MSDN) Web site:

Modification Type:MinorLast Reviewed:12/30/2005
Keywords:kbCompiler kbbug KB839284 kbAudDeveloper kbAudITPRO