Author: manjula
Date: 2005-05-26 06:18:20 -0400 (Thu, 26 May 2005)
New Revision: 45036

Modified:
   trunk/mcs/mbas/ChangeLog
   trunk/mcs/mbas/typemanager.cs
Log:
Fix Enum conversion for two level assignment and added few more cases


Modified: trunk/mcs/mbas/ChangeLog
===================================================================
--- trunk/mcs/mbas/ChangeLog    2005-05-26 10:09:02 UTC (rev 45035)
+++ trunk/mcs/mbas/ChangeLog    2005-05-26 10:18:20 UTC (rev 45036)
@@ -1,4 +1,6 @@
 2005-05-26 Manjula GHM <[EMAIL PROTECTED]>
+       * typemanager.cs : Fix Enum conversion for two level assignment and 
added few more cases
+2005-05-26 Manjula GHM <[EMAIL PROTECTED]>
        * statement.cs : Fix problem w.r.t 'Exit Sub' 
 2005-05-24 Satya Sudha K <[EMAIL PROTECTED]>
        * statement.cs : Added few more members like 'memberName' and 
'type_expr' to the 'StatementSequence'

Modified: trunk/mcs/mbas/typemanager.cs
===================================================================
--- trunk/mcs/mbas/typemanager.cs       2005-05-26 10:09:02 UTC (rev 45035)
+++ trunk/mcs/mbas/typemanager.cs       2005-05-26 10:18:20 UTC (rev 45036)
@@ -3,6 +3,7 @@
 //
 // Author: Miguel de Icaza ([EMAIL PROTECTED])
 //         Ravi Pratap     ([EMAIL PROTECTED])
+//         Manjula GHM     ([EMAIL PROTECTED])
 //
 // Licensed under the terms of the GNU GPL
 //
@@ -1828,9 +1829,26 @@
                                        t == TypeManager.int32_type ||
                                        t == TypeManager.uint32_type ||
                                        t == TypeManager.int64_type ||
+                                       t == TypeManager.float_type ||
+                                       t == TypeManager.double_type ||
+                                       t == TypeManager.decimal_type ||
                                        t == TypeManager.uint64_type)
                                return t;
-                       throw new Exception ("Unhandled typecode in enum " + " 
from " + t.AssemblyQualifiedName);
+                       // Following line is commented out to handle case like 
+                       // Module M
+                       // Enum E
+                       //      A
+                       //      B
+                       // End Enum
+                       // Sub Main
+                       //      Dim e1 As E
+                       //      Dim i As Integer
+                       //      e1 = E.A
+                       //      i = e1
+                       // End Sub
+                       // End Module
+
+                       // throw new Exception ("Unhandled typecode in enum " + 
" from " + t.AssemblyQualifiedName);
                }
                TypeCode tc = Type.GetTypeCode (t);
 
@@ -1855,6 +1873,12 @@
                        return TypeManager.int64_type;
                case TypeCode.UInt64:
                        return TypeManager.uint64_type;
+               case TypeCode.Single:
+                       return TypeManager.float_type;
+               case TypeCode.Double:
+                       return TypeManager.double_type;
+               case TypeCode.Decimal:
+                       return TypeManager.decimal_type;
                }
                throw new Exception ("Unhandled typecode in enum " + tc + " 
from " + t.AssemblyQualifiedName);
        }

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

Reply via email to