Microsoft KB Archive/315549

= FIX: You receive a compiler error message when you specify the LayoutKind attribute as Sequential or Explicit and define a property on a __value class in Visual Studio .NET =

Article ID: 315549

Article Last Modified on 8/24/2005

-

APPLIES TO


 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition

-



This article was previously published under Q315549



SYMPTOMS
When you specify the LayoutKind attribute as Sequential or Explicit, and you define a property on a _value class, and then you try to compile the code, you receive the following error message:

&quot;fatal error C1001: INTERNAL COMPILER ERROR

(compiler file 'msc1.cpp', line 2844)

Please choose the Technical Support command on the Visual C++

Help menu, or open the Technical Support help file for more information&quot;

This behavior occurs when you define a property on a __gc class, also.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in all versions of Visual Studio .NET (2003).



Steps to Reproduce the Behavior
The following sample code demonstrates the error: /* Compile options needed: cl.exe /clr
 * 1) using 
 * 1) using 

using namespace System::Runtime::InteropServices;

[StructLayout(LayoutKind::Sequential)] public __value class Vector2 { protected: float vec __nogc[2]; public: // Accesses the indexed component of a vector. __property float get_elt(int i) { return(vec[i]); } __property void set_elt(int i, float v) { vec[i]=v; } };

Additional query words: kbCompiler kbVC

Keywords: kbbug kbfix kbpending kbvs2002sp1sweep KB315549

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.