locked
An internal error has occurred in the compiler

    Question

  • I have the following code:

     

    	public ref class Unit sealed
    	{
    	private:
    		int _id;
    
    	public:
    		Unit();
    		~Unit();
    		Unit(const Unit% copy);
    
    		property int ID
    		{
    			int get() {return _id;}
    			void set(int id) {_id = id;}
    		}
    	};
    
        public interface class IConverter
        {
    		double Convert(Unit from, double fromValue);
        };
    

     


    Obviously, there is something wrong with the method Convert, the first parameter is missing the hat, it should be Unit^. However, the error I get is:

    C:\Work\UnitConverter\UnitConverterCore\LengthConverter.cpp : fatal error C1001: An internal error has occurred in the compiler. (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 210) To work around this problem, try simplifying or changing the program near the locations listed above. Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information

    I think that's the last error you'd expect in this case. Took me a while to figure where the actual problem was.


    Microsoft MVP VC++ | www.mariusbancila.ro/blog | www.codexpert.ro
    Sunday, September 25, 2011 7:15 AM

All replies