Author: marek
Date: 2007-01-02 08:07:24 -0500 (Tue, 02 Jan 2007)
New Revision: 70352

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/class.cs
   trunk/mcs/mcs/ecore.cs
Log:
2007-01-02  Marek Safar  <[EMAIL PROTECTED]>

        * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
        where field type is struct from current assembly.
        
        * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
        it is possible.

Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2007-01-02 12:34:29 UTC (rev 70351)
+++ trunk/mcs/mcs/ChangeLog     2007-01-02 13:07:24 UTC (rev 70352)
@@ -1,5 +1,13 @@
 2007-01-02  Marek Safar  <[EMAIL PROTECTED]>
 
+       * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
+       where field type is struct from current assembly.
+       
+       * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
+       it is possible.
+
+2007-01-02  Marek Safar  <[EMAIL PROTECTED]>
+
        A fix for bug #80381
        * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
        the core types.

Modified: trunk/mcs/mcs/class.cs
===================================================================
--- trunk/mcs/mcs/class.cs      2007-01-02 12:34:29 UTC (rev 70351)
+++ trunk/mcs/mcs/class.cs      2007-01-02 13:07:24 UTC (rev 70352)
@@ -2253,8 +2253,9 @@
                                                if ((f.caching_flags & 
Flags.IsAssigned) != 0)
                                                        continue;
                                                
+                                               Constant c = New.Constantify 
(f.Type.Type);
                                                Report.Warning (649, 4, 
f.Location, "Field `{0}' is never assigned to, and will always have its default 
value `{1}'",
-                                                       f.GetSignatureForError 
(), f.Type.Type.IsValueType ? Activator.CreateInstance (f.Type.Type).ToString() 
: "null");
+                                                       f.GetSignatureForError 
(), c == null ? "null" : c.AsString ());
                                        }
                                }
                        }

Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs      2007-01-02 12:34:29 UTC (rev 70351)
+++ trunk/mcs/mcs/ecore.cs      2007-01-02 13:07:24 UTC (rev 70352)
@@ -1478,7 +1478,8 @@
                
                public override string AsString ()
                {
-                       return Child.AsString ();
+                       string value = System.Enum.GetName (type, 
Child.GetValue ());
+                       return value == null ? "0" : value;
                }
 
                public override Constant Increment()

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

Reply via email to