2007-02-20 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Tue, 20 Feb 2007 22:28:04 +0000 (22:28 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 20 Feb 2007 22:28:04 +0000 (22:28 -0000)
* class.cs, report.cs: Capture more details when things go wrong.

svn path=/trunk/mcs/; revision=73222

mcs/mcs/ChangeLog
mcs/mcs/class.cs
mcs/mcs/report.cs

index 1265b3c56eb3988a3bbfd031348016a370d166bb..a7c19cda23952c2344a9abe4313e2fc21c5876dc 100644 (file)
@@ -1,3 +1,7 @@
+2007-02-20  Marek Safar  <marek.safar@gmail.com>
+
+       * class.cs, report.cs: Capture more details when things go wrong.
+
 2007-02-20  Marek Safar  <marek.safar@gmail.com>
 
        A fix for bug #80650
index c10f2d607450f6fb188d68dcc7ff7607ef576507..5d2ee09446dc8a7fc46c1825b331bd0734e2ef8a 100644 (file)
@@ -75,7 +75,7 @@ namespace Mono.CSharp {
                                        try {
                                                mc.Define ();
                                        } catch (Exception e) {
-                                               throw new InternalErrorException (mc.Location, mc.GetSignatureForError (), e);
+                                               throw new InternalErrorException (mc, e);
                                        }
                                }
                        }
@@ -2271,7 +2271,12 @@ namespace Mono.CSharp {
                                bool has_compliant_args = false;
 
                                foreach (Constructor c in instance_constructors) {
-                                       c.Emit ();
+                                       try {
+                                               c.Emit ();
+                                       }
+                                       catch (Exception e) {
+                                               throw new InternalErrorException (c, e);
+                                       }
 
                                        if (has_compliant_args)
                                                continue;
@@ -2281,8 +2286,14 @@ namespace Mono.CSharp {
                                if (!has_compliant_args)
                                        Report.Error (3015, Location, "`{0}' has no accessible constructors which use only CLS-compliant types", GetSignatureForError ());
                        } else {
-                               foreach (Constructor c in instance_constructors)
-                                       c.Emit ();
+                               foreach (Constructor c in instance_constructors) {
+                                       try {
+                                               c.Emit ();
+                                       }
+                                       catch (Exception e) {
+                                               throw new InternalErrorException (c, e);
+                                       }
+                               }
                        }
                }
 
index dc2c7994d04504e75151b2145913042cffeb3883..61cd03f66f82b1ac5c09fd8f9f18da07614b731b 100644 (file)
@@ -653,8 +653,8 @@ namespace Mono.CSharp {
        }
 
        public class InternalErrorException : Exception {
-               public InternalErrorException (Location loc, string text, Exception e)
-                       : base (loc + " " + text, e)
+               public InternalErrorException (MemberCore mc, Exception e)
+                       : base (mc.Location + " " + mc.GetSignatureForError (), e)
                {
                }