Author: jambunathan
Date: 2005-03-25 11:50:13 -0500 (Fri, 25 Mar 2005)
New Revision: 42250

Modified:
   trunk/mcs/bmcs/AssemblyInfo.cs
   trunk/mcs/bmcs/ChangeLog
   trunk/mcs/bmcs/convert.cs
   trunk/mcs/bmcs/literal.cs
   trunk/mcs/bmcs/statement.cs
   trunk/mcs/bmcs/typemanager.cs
Log:

        
* AssemblyInfo.cs: Set assembly version to 0.1

* literal.cs (NotDefinedAsPrimitiveType): New class. Unlike C#,
VB.NET doesn't understand "signed byte", "unsigned short",
"unsigned int" and "unsigned long" as primitive types. This class
has been introduced just to "accomodate" this fact. Now we can
retain most of the existing gmcs code that test against these
types for doing language defined conversions.
        
* typemanager.cs (sbyte_type, short_type, uint32_type,uint64_type): 
Converted as static properties that return typeof(NotDefinedAsPrimitiveType). 
        
The existing sbyte_type, short_type, uint32_type, uint64_type are
renamed as _sbyte_type, _short_type, _uint32_type,
_uint64_type. Their accessibility type is now private.

* convert.cs (NarrowingNumericConversion, WideningNumericConversion): 
Reverted original gmcs code that handle byte type and unsigned
numeric types. Remember that all this code is a "nop" because
of the introduction of NotDefinedAsPrimitiveType class.


Modified: trunk/mcs/bmcs/AssemblyInfo.cs
===================================================================
--- trunk/mcs/bmcs/AssemblyInfo.cs      2005-03-25 15:22:30 UTC (rev 42249)
+++ trunk/mcs/bmcs/AssemblyInfo.cs      2005-03-25 16:50:13 UTC (rev 42250)
@@ -1,7 +1,7 @@
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
-[assembly: AssemblyVersion("1.1.4")]
+[assembly: AssemblyVersion("0.1")]
 [assembly: AssemblyTitle ("Mono VB.NET Compiler")]
 [assembly: AssemblyDescription ("Mono VB.NET Compiler with Generics")]
 [assembly: AssemblyCopyright ("2001, 2002, 2003 Ximian, Inc.")]

Modified: trunk/mcs/bmcs/ChangeLog
===================================================================
--- trunk/mcs/bmcs/ChangeLog    2005-03-25 15:22:30 UTC (rev 42249)
+++ trunk/mcs/bmcs/ChangeLog    2005-03-25 16:50:13 UTC (rev 42250)
@@ -1,3 +1,27 @@
+2005-03-25  Jambunathan K  <[EMAIL PROTECTED]>
+       
+       * AssemblyInfo.cs: Set assembly version to 0.1
+
+       * literal.cs (NotDefinedAsPrimitiveType): New class. Unlike C#,
+       VB.NET doesn't understand "signed byte", "unsigned short",
+       "unsigned int" and "unsigned long" as primitive types. This class
+       has been introduced just to "accomodate" this fact. Now we can
+       retain most of the existing gmcs code that test against these
+       types for doing language defined conversions.
+       
+       * typemanager.cs (sbyte_type, short_type, uint32_type,uint64_type): 
+       Converted as static properties that return 
typeof(NotDefinedAsPrimitiveType). 
+       
+       The existing sbyte_type, short_type, uint32_type, uint64_type are
+       renamed as _sbyte_type, _short_type, _uint32_type,
+       _uint64_type. Their accessibility type is now private.
+
+       * convert.cs (NarrowingNumericConversion, WideningNumericConversion): 
+       Reverted original gmcs code that handle byte type and unsigned
+       numeric types. Remember that all this code is a "nop" because
+       of the introduction of NotDefinedAsPrimitiveType class.
+
+
 2005-03-23  Jambunathan K  <[EMAIL PROTECTED]>
        * Merged with GMCS trunk 42056
        

Modified: trunk/mcs/bmcs/convert.cs
===================================================================
--- trunk/mcs/bmcs/convert.cs   2005-03-25 15:22:30 UTC (rev 42249)
+++ trunk/mcs/bmcs/convert.cs   2005-03-25 16:50:13 UTC (rev 42250)
@@ -419,14 +419,32 @@
                        
                        Type real_target_type = target_type;
 
-                        if (expr_type == TypeManager.byte_type){
+                       if (expr_type == TypeManager.sbyte_type){
                                //
+                               // From sbyte to short, int, long, float, 
double.
+                               //
+                               if (real_target_type == TypeManager.int32_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_I4);
+                               if (real_target_type == TypeManager.int64_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_I8);
+                               if (real_target_type == TypeManager.double_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R8);
+                               if (real_target_type == TypeManager.float_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R4);
+                               if (real_target_type == TypeManager.short_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_I2);
+                       } else if (expr_type == TypeManager.byte_type){
+                               //
                                // From byte to short, ushort, int, uint, long, 
ulong, float, double
                                // 
                                if ((real_target_type == 
TypeManager.short_type) ||
-                                   (real_target_type == 
TypeManager.int32_type))
+                                   (real_target_type == 
TypeManager.ushort_type) ||
+                                   (real_target_type == 
TypeManager.int32_type) ||
+                                   (real_target_type == 
TypeManager.uint32_type))
                                        return new EmptyCast (expr, 
target_type);
 
+                               if (real_target_type == TypeManager.uint64_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_U8);
                                if (real_target_type == TypeManager.int64_type)
                                        return new OpcodeCast (expr, 
target_type, OpCodes.Conv_I8);
                                if (real_target_type == TypeManager.float_type)
@@ -449,6 +467,23 @@
                                        return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R4);
                                if (real_target_type == 
TypeManager.decimal_type)
                                        return new ImplicitNew (ec, "System", 
"Decimal", loc, expr);
+                       } else if (expr_type == TypeManager.ushort_type){
+                               //
+                               // From ushort to int, uint, long, ulong, 
float, double
+                               //
+                               if (real_target_type == TypeManager.uint32_type)
+                                       return new EmptyCast (expr, 
target_type);
+
+                               if (real_target_type == TypeManager.uint64_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_U8);
+                               if (real_target_type == TypeManager.int32_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_I4);
+                               if (real_target_type == TypeManager.int64_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_I8);
+                               if (real_target_type == TypeManager.double_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R8);
+                               if (real_target_type == TypeManager.float_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R4);
                        } else if (expr_type == TypeManager.int32_type){
                                //
                                // From int to long, float, double
@@ -461,6 +496,30 @@
                                        return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R4);
                                if (real_target_type == 
TypeManager.decimal_type)
                                        return new ImplicitNew (ec, "System", 
"Decimal", loc, expr);
+                       } else if (expr_type == TypeManager.uint32_type){
+                               //
+                               // From uint to long, ulong, float, double
+                               //
+                               if (real_target_type == TypeManager.int64_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_U8);
+                               if (real_target_type == TypeManager.uint64_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_U8);
+                               if (real_target_type == TypeManager.double_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R_Un,
+                                                              OpCodes.Conv_R8);
+                               if (real_target_type == TypeManager.float_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R_Un,
+                                                              OpCodes.Conv_R4);
+                       } else if (expr_type == TypeManager.uint64_type){
+                               //
+                               // From ulong to float, double
+                               //
+                               if (real_target_type == TypeManager.double_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R_Un,
+                                                              OpCodes.Conv_R8);
+                               if (real_target_type == TypeManager.float_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R_Un,
+                                                              
OpCodes.Conv_R4);        
                        } else if (expr_type == TypeManager.int64_type){
                                //
                                // From long/ulong to float, double
@@ -471,6 +530,12 @@
                                        return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R4);     
                                if (real_target_type == 
TypeManager.decimal_type)
                                        return new ImplicitNew (ec, "System", 
"Decimal", loc, expr);    
+                       } else if (expr_type == TypeManager.float_type){
+                               //
+                               // float to double
+                               //
+                               if (real_target_type == TypeManager.double_type)
+                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R8);
                        } else if (expr_type == TypeManager.decimal_type){
                                //
                                // From decimal to float, double
@@ -479,12 +544,6 @@
                                        return new ImplicitInvocation (ec, 
"System", "Convert", "ToDouble", loc, expr); 
                                if (real_target_type == TypeManager.float_type)
                                        return new ImplicitInvocation (ec, 
"System", "Convert" ,"ToSingle", loc, expr); 
-                       } else if (expr_type == TypeManager.float_type){
-                               //
-                               // float to double
-                               //
-                               if (real_target_type == TypeManager.double_type)
-                                       return new OpcodeCast (expr, 
target_type, OpCodes.Conv_R8);
                        }
 
                        return null;
@@ -1466,72 +1525,181 @@
                                return ce;
                        }
                        
-                       if (expr_type == TypeManager.short_type){
+                       if (expr_type == TypeManager.sbyte_type){
                                //
+                               // From sbyte to byte, ushort, uint, ulong, char
+                               //
+                               if (real_target_type == TypeManager.byte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I1_U1);
+                               if (real_target_type == TypeManager.ushort_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I1_U2);
+                               if (real_target_type == TypeManager.uint32_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I1_U4);
+                               if (real_target_type == TypeManager.uint64_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I1_U8);
+                               if (real_target_type == TypeManager.char_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I1_CH);
+                       } else if (expr_type == TypeManager.byte_type){
+                               //
+                               // From byte to sbyte and char
+                               //
+                               if (real_target_type == TypeManager.sbyte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U1_I1);
+                       } else if (expr_type == TypeManager.short_type){
+                               //
                                // From short to byte
                                //
+                               if (real_target_type == TypeManager.sbyte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I2_I1);
                                if (real_target_type == TypeManager.byte_type)
                                        return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I2_U1);
+                               if (real_target_type == TypeManager.ushort_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I2_U2);
+                               if (real_target_type == TypeManager.uint32_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I2_U4);
+                               if (real_target_type == TypeManager.uint64_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I2_U8);
+                       } else if (expr_type == TypeManager.ushort_type){
+                               //
+                               // From ushort to sbyte, byte, short, char
+                               //
+                               if (real_target_type == TypeManager.sbyte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U2_I1);
+                               if (real_target_type == TypeManager.byte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U2_U1);
+                               if (real_target_type == TypeManager.short_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U2_I2);
+                               if (real_target_type == TypeManager.char_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U2_CH);
                        } else if (expr_type == TypeManager.int32_type){
                                //
                                // From int to byte, short
                                //
+                               if (real_target_type == TypeManager.sbyte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I4_I1);
                                if (real_target_type == TypeManager.byte_type)
                                        return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I4_U1);
                                if (real_target_type == TypeManager.short_type)
                                        return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I4_I2);
+                               if (real_target_type == TypeManager.ushort_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I4_U2);
+                               if (real_target_type == TypeManager.uint32_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I4_U4);
+                               if (real_target_type == TypeManager.uint64_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I4_U8);
+                       } else if (expr_type == TypeManager.uint32_type){
+                               //
+                               // From uint to sbyte, byte, short, ushort, 
int, char
+                               //
+                               if (real_target_type == TypeManager.sbyte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U4_I1);
+                               if (real_target_type == TypeManager.byte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U4_U1);
+                               if (real_target_type == TypeManager.short_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U4_I2);
+                               if (real_target_type == TypeManager.ushort_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U4_U2);
+                               if (real_target_type == TypeManager.int32_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U4_I4);
+                               if (real_target_type == TypeManager.char_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U4_CH);
                        } else if (expr_type == TypeManager.int64_type){
                                //
                                // From long to byte, short, int
                                //
+                               if (real_target_type == TypeManager.sbyte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I8_I1);
                                if (real_target_type == TypeManager.byte_type)
                                        return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I8_U1);
                                if (real_target_type == TypeManager.short_type)
                                        return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I8_I2);
+                               if (real_target_type == TypeManager.ushort_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I8_U2);
                                if (real_target_type == TypeManager.int32_type)
                                        return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I8_I4);
-                       } else if (expr_type == TypeManager.decimal_type){
+                               if (real_target_type == TypeManager.uint32_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I8_U4);
+                               if (real_target_type == TypeManager.uint64_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.I8_U8);
+                       } else if (expr_type == TypeManager.uint64_type){
                                //
-                               // From decimal to byte, short, int, long
+                               // From ulong to sbyte, byte, short, ushort, 
int, uint, long, char
                                //
+                               if (real_target_type == TypeManager.sbyte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U8_I1);
                                if (real_target_type == TypeManager.byte_type)
-                                       return new ImplicitInvocation (ec, 
"System", "Convert" , "ToByte", loc, expr);  
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U8_U1);
                                if (real_target_type == TypeManager.short_type)
-                                       return new ImplicitInvocation (ec, 
"System", "Convert", "ToInt16", loc, expr);  
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U8_I2);
+                               if (real_target_type == TypeManager.ushort_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U8_U2);
                                if (real_target_type == TypeManager.int32_type)
-                                       return new ImplicitInvocation (ec, 
"System", "Convert", "ToInt32", loc, expr);  
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U8_I4);
+                               if (real_target_type == TypeManager.uint32_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U8_U4);
                                if (real_target_type == TypeManager.int64_type)
-                                       return new ImplicitInvocation (ec, 
"System", "Convert", "ToInt64", loc, expr);  
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U8_I8);
+                               if (real_target_type == TypeManager.char_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.U8_CH);
                        } else if (expr_type == TypeManager.float_type){
                                //
                                // From float to byte, short, int, long, decimal
                                //
+                               if (real_target_type == TypeManager.sbyte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R4_I1);
                                if (real_target_type == TypeManager.byte_type)
                                        return new FloatingToFixedCast (ec, 
expr, target_type, ConvCast.Mode.R8_U1);
                                if (real_target_type == TypeManager.short_type)
                                        return new FloatingToFixedCast (ec, 
expr, target_type, ConvCast.Mode.R8_I2);
+                               if (real_target_type == TypeManager.ushort_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R4_U2);
                                if (real_target_type == TypeManager.int32_type)
                                        return new FloatingToFixedCast (ec, 
expr, target_type, ConvCast.Mode.R8_I4);
+                               if (real_target_type == TypeManager.uint32_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R4_U4);
                                if (real_target_type == TypeManager.int64_type)
                                        return new FloatingToFixedCast (ec, 
expr, target_type, ConvCast.Mode.R8_I8);
+                               if (real_target_type == TypeManager.uint64_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R4_U8);
                                if (real_target_type == 
TypeManager.decimal_type)
                                        return new ImplicitNew (ec, "System", 
"Decimal", loc, expr);    
                        } else if (expr_type == TypeManager.double_type){
                                //
                                // From double to byte, short, int, long, 
float, decimal
                                //
+                               if (real_target_type == TypeManager.sbyte_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R8_I1);
                                if (real_target_type == TypeManager.byte_type)
                                        return new FloatingToFixedCast (ec, 
expr, target_type, ConvCast.Mode.R8_U1);
                                if (real_target_type == TypeManager.short_type)
                                        return new FloatingToFixedCast (ec, 
expr, target_type, ConvCast.Mode.R8_I2);
+                               if (real_target_type == TypeManager.ushort_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R8_U2);
                                if (real_target_type == TypeManager.int32_type)
                                        return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R8_I4);
+                               if (real_target_type == TypeManager.uint32_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R8_U4);
                                if (real_target_type == TypeManager.int64_type)
                                        return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R8_I8);
+                               if (real_target_type == TypeManager.uint64_type)
+                                       return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R8_U8);
+
                                if (real_target_type == TypeManager.float_type)
                                        return new ConvCast (ec, expr, 
target_type, ConvCast.Mode.R8_R4);
                                if (real_target_type == 
TypeManager.decimal_type)
                                        return new ImplicitNew (ec, "System", 
"Decimal", loc, expr);
+                       } else if (expr_type == TypeManager.decimal_type){
+                               //
+                               // From decimal to byte, short, int, long
+                               //
+                               if (real_target_type == TypeManager.byte_type)
+                                       return new ImplicitInvocation (ec, 
"System", "Convert" , "ToByte", loc, expr);  
+                               if (real_target_type == TypeManager.short_type)
+                                       return new ImplicitInvocation (ec, 
"System", "Convert", "ToInt16", loc, expr);  
+                               if (real_target_type == TypeManager.int32_type)
+                                       return new ImplicitInvocation (ec, 
"System", "Convert", "ToInt32", loc, expr);  
+                               if (real_target_type == TypeManager.int64_type)
+                                       return new ImplicitInvocation (ec, 
"System", "Convert", "ToInt64", loc, expr);  
                        } 
 
                        return null;

Modified: trunk/mcs/bmcs/literal.cs
===================================================================
--- trunk/mcs/bmcs/literal.cs   2005-03-25 15:22:30 UTC (rev 42249)
+++ trunk/mcs/bmcs/literal.cs   2005-03-25 16:50:13 UTC (rev 42250)
@@ -37,6 +37,15 @@
 namespace Mono.CSharp {
 
        //
+       // Unlike C#, VB.NET doesn't understand "signed byte",
+       // "unsigned short", "unsigned int" and "unsigned long" as
+       // primitive types. The NotDefinedAsPrimitiveType just exists
+       // to accomodate this fact.
+       //
+       public class NotDefinedAsPrimitiveType {
+       }
+
+       //
        // The NullType just exists to compare type equality, and for
        // expressions that might have the `null type'
        //

Modified: trunk/mcs/bmcs/statement.cs
===================================================================
--- trunk/mcs/bmcs/statement.cs 2005-03-25 15:22:30 UTC (rev 42249)
+++ trunk/mcs/bmcs/statement.cs 2005-03-25 16:50:13 UTC (rev 42250)
@@ -719,7 +719,6 @@
                {
                        ec.CurrentBranching.Label (vectors);
 
-
                        return true;
                }
 

Modified: trunk/mcs/bmcs/typemanager.cs
===================================================================
--- trunk/mcs/bmcs/typemanager.cs       2005-03-25 15:22:30 UTC (rev 42249)
+++ trunk/mcs/bmcs/typemanager.cs       2005-03-25 16:50:13 UTC (rev 42250)
@@ -38,9 +38,9 @@
        static public Type value_type;
        static public Type string_type;
        static public Type int32_type;
-       static public Type uint32_type;
+       static Type _uint32_type;
        static public Type int64_type;
-       static public Type uint64_type;
+       static Type _uint64_type;
        static public Type float_type;
        static public Type double_type;
        static public Type char_type;
@@ -48,9 +48,9 @@
        static public Type short_type;
        static public Type decimal_type;
        static public Type bool_type;
-       static public Type sbyte_type;
+       static public Type _sbyte_type;
        static public Type byte_type;
-       static public Type ushort_type;
+       static public Type _ushort_type;
        static public Type enum_type;
        static public Type delegate_type;
        static public Type multicast_delegate_type;
@@ -101,6 +101,42 @@
        static public Type date_type;
 
        //
+       // Unlike C#, VB.NET doesn't understand "signed byte",
+       // "unsigned short" and "unsigned int" as primitive types. The
+       // NotDefinedAsPrimitiveType just exists to accomodate this fact.
+       //
+
+       static Type not_defined_as_primitive_type = typeof 
(NotDefinedAsPrimitiveType);
+
+       public static Type sbyte_type {
+               get {
+                       return not_defined_as_primitive_type;
+               }
+
+       }
+
+       public static Type ushort_type {
+               get {
+                       return not_defined_as_primitive_type;
+               }
+
+       }
+
+       public static Type uint32_type {
+               get {
+                       return not_defined_as_primitive_type;
+               }
+
+       }
+
+       public static Type uint64_type {
+               get {
+                       return not_defined_as_primitive_type;
+               }
+
+       }
+
+       //
        // An empty array of types
        //
        static public Type [] NoTypes;
@@ -1090,12 +1126,12 @@
 
                int32_type    = CoreLookupType ("System.Int32");
                int64_type    = CoreLookupType ("System.Int64");
-               uint32_type   = CoreLookupType ("System.UInt32"); 
-               uint64_type   = CoreLookupType ("System.UInt64"); 
+               _uint32_type   = CoreLookupType ("System.UInt32"); 
+               _uint64_type   = CoreLookupType ("System.UInt64"); 
                byte_type     = CoreLookupType ("System.Byte");
-               sbyte_type    = CoreLookupType ("System.SByte");
+               _sbyte_type    = CoreLookupType ("System.SByte");
                short_type    = CoreLookupType ("System.Int16");
-               ushort_type   = CoreLookupType ("System.UInt16");
+               _ushort_type   = CoreLookupType ("System.UInt16");
        }
        
        /// <remarks>
@@ -1259,14 +1295,14 @@
                system_decimal_expr.Type = decimal_type;
                system_single_expr.Type = float_type;
                system_double_expr.Type = double_type;
-               system_sbyte_expr.Type = sbyte_type;
+               system_sbyte_expr.Type = _sbyte_type;
                system_byte_expr.Type = byte_type;
                system_int16_expr.Type = short_type;
-               system_uint16_expr.Type = ushort_type;
+               system_uint16_expr.Type = _ushort_type;
                system_int32_expr.Type = int32_type;
-               system_uint32_expr.Type = uint32_type;
+               system_uint32_expr.Type = _uint32_type;
                system_int64_expr.Type = int64_type;
-               system_uint64_expr.Type = uint64_type;
+               system_uint64_expr.Type = _uint64_type;
                system_char_expr.Type = char_type;
                system_void_expr.Type = void_type;
                system_asynccallback_expr.Type = asynccallback_type;
@@ -1412,7 +1448,7 @@
                        unverifiable_code_type, void_arg);
 
                decimal_constant_attribute_ctor = GetConstructor 
(decimal_constant_attribute_type, new Type []
-                       { byte_type, byte_type, uint32_type, uint32_type, 
uint32_type } );
+                       { byte_type, byte_type, _uint32_type, _uint32_type, 
_uint32_type } );
 
                default_member_ctor = GetConstructor (default_member_type, 
string_);
 
@@ -1584,10 +1620,10 @@
 
        public static bool IsBuiltinType (Type t)
        {
-               if (t == object_type || t == string_type || t == int32_type || 
t == uint32_type ||
-                   t == int64_type || t == uint64_type || t == float_type || t 
== double_type ||
+               if (t == object_type || t == string_type || t == int32_type || 
t == _uint32_type ||
+                   t == int64_type || t == _uint64_type || t == float_type || 
t == double_type ||
                    t == char_type || t == short_type || t == decimal_type || t 
== bool_type ||
-                   t == sbyte_type || t == byte_type || t == ushort_type || t 
== void_type)
+                   t == _sbyte_type || t == byte_type || t == _ushort_type || 
t == void_type)
                        return true;
                else
                        return false;
@@ -1604,10 +1640,10 @@
        // 
        public static bool IsCLRType (Type t)
        {
-               if (t == object_type || t == int32_type || t == uint32_type ||
-                   t == int64_type || t == uint64_type || t == float_type || t 
== double_type ||
+               if (t == object_type || t == int32_type || t == _uint32_type ||
+                   t == int64_type || t == _uint64_type || t == float_type || 
t == double_type ||
                    t == char_type || t == short_type || t == bool_type ||
-                   t == sbyte_type || t == byte_type || t == ushort_type)
+                   t == _sbyte_type || t == byte_type || t == _ushort_type)
                        return true;
                else
                        return false;
@@ -2347,14 +2383,14 @@
                        // slow path needed to compile corlib
                        if (t == TypeManager.bool_type ||
                                        t == TypeManager.byte_type ||
-                                       t == TypeManager.sbyte_type ||
+                                       t == TypeManager._sbyte_type ||
                                        t == TypeManager.char_type ||
                                        t == TypeManager.short_type ||
-                                       t == TypeManager.ushort_type ||
+                                       t == TypeManager._ushort_type ||
                                        t == TypeManager.int32_type ||
-                                       t == TypeManager.uint32_type ||
+                                       t == TypeManager._uint32_type ||
                                        t == TypeManager.int64_type ||
-                                       t == TypeManager.uint64_type)
+                                       t == TypeManager._uint64_type)
                                return t;
                        throw new Exception ("Unhandled typecode in enum " + " 
from " + t.AssemblyQualifiedName);
                }
@@ -2366,21 +2402,21 @@
                case TypeCode.Byte:
                        return TypeManager.byte_type;
                case TypeCode.SByte:
-                       return TypeManager.sbyte_type;
+                       return TypeManager._sbyte_type;
                case TypeCode.Char:
                        return TypeManager.char_type;
                case TypeCode.Int16:
                        return TypeManager.short_type;
                case TypeCode.UInt16:
-                       return TypeManager.ushort_type;
+                       return TypeManager._ushort_type;
                case TypeCode.Int32:
                        return TypeManager.int32_type;
                case TypeCode.UInt32:
-                       return TypeManager.uint32_type;
+                       return TypeManager._uint32_type;
                case TypeCode.Int64:
                        return TypeManager.int64_type;
                case TypeCode.UInt64:
-                       return TypeManager.uint64_type;
+                       return TypeManager._uint64_type;
                }
                throw new Exception ("Unhandled typecode in enum " + tc + " 
from " + t.AssemblyQualifiedName);
        }
@@ -2402,21 +2438,21 @@
                case TypeCode.Byte:
                        return TypeManager.byte_type;
                case TypeCode.SByte:
-                       return TypeManager.sbyte_type;
+                       return TypeManager._sbyte_type;
                case TypeCode.Char:
                        return TypeManager.char_type;
                case TypeCode.Int16:
                        return TypeManager.short_type;
                case TypeCode.UInt16:
-                       return TypeManager.ushort_type;
+                       return TypeManager._ushort_type;
                case TypeCode.Int32:
                        return TypeManager.int32_type;
                case TypeCode.UInt32:
-                       return TypeManager.uint32_type;
+                       return TypeManager._uint32_type;
                case TypeCode.Int64:
                        return TypeManager.int64_type;
                case TypeCode.UInt64:
-                       return TypeManager.uint64_type;
+                       return TypeManager._uint64_type;
                case TypeCode.Single:
                        return TypeManager.float_type;
                case TypeCode.Double:

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to