Author: marek
Date: 2007-07-04 06:30:26 -0400 (Wed, 04 Jul 2007)
New Revision: 81325

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/anonymous.cs
   trunk/mcs/mcs/ecore.cs
   trunk/mcs/mcs/lambda.cs
Log:
2007-07-04  Marek Safar  <[EMAIL PROTECTED]>

        * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
        
        * anonymous.cs,
        * lambda.cs: Add custom error message type.



Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2007-07-04 09:48:40 UTC (rev 81324)
+++ trunk/mcs/mcs/ChangeLog     2007-07-04 10:30:26 UTC (rev 81325)
@@ -1,3 +1,10 @@
+2007-07-04  Marek Safar  <[EMAIL PROTECTED]>
+
+       * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
+       
+       * anonymous.cs,
+       * lambda.cs: Add custom error message type.
+
 2007-07-03  Marek Safar  <[EMAIL PROTECTED]>
 
        * lambda.cs: Simplified little bit.

Modified: trunk/mcs/mcs/anonymous.cs
===================================================================
--- trunk/mcs/mcs/anonymous.cs  2007-07-04 09:48:40 UTC (rev 81324)
+++ trunk/mcs/mcs/anonymous.cs  2007-07-04 10:30:26 UTC (rev 81325)
@@ -1413,6 +1413,11 @@
                        // nothing, as we only exist to not do anything.
                }
 
+               public override string GetSignatureForError ()
+               {
+                       return ExprClassName;
+               }
+               
                public bool IsIterator {
                        get { return false; }
                }

Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs      2007-07-04 09:48:40 UTC (rev 81324)
+++ trunk/mcs/mcs/ecore.cs      2007-07-04 10:30:26 UTC (rev 81325)
@@ -5040,9 +5040,9 @@
                                throw new InternalErrorException ("An 
implicitly typed local variable could not be redefined");
                        
                        type = right_side.Type;
-                       if (type == TypeManager.null_type || type == 
TypeManager.void_type) {
+                       if (type == TypeManager.null_type || type == 
TypeManager.void_type || type == TypeManager.anonymous_method_type) {
                                Report.Error (815, loc, "An implicitly typed 
local variable declaration cannot be initialized with `{0}'",
-                                             TypeManager.CSharpName (type));
+                                             right_side.GetSignatureForError 
());
                                return null;
                        }
 

Modified: trunk/mcs/mcs/lambda.cs
===================================================================
--- trunk/mcs/mcs/lambda.cs     2007-07-04 09:48:40 UTC (rev 81324)
+++ trunk/mcs/mcs/lambda.cs     2007-07-04 10:30:26 UTC (rev 81325)
@@ -161,6 +161,11 @@
                        return anonymous.AnonymousDelegate;
                }
                
+               public override string GetSignatureForError ()
+               {
+                       return "lambda expression";
+               }
+
                //
                // TryBuild: tries to compile this LambdaExpression with the 
given
                // types as the lambda expression parameter types.   

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

Reply via email to