**** Merged r37312-r37380 from MCS ****
authorMartin Baulig <martin@novell.com>
Mon, 24 Jan 2005 23:39:23 +0000 (23:39 -0000)
committerMartin Baulig <martin@novell.com>
Mon, 24 Jan 2005 23:39:23 +0000 (23:39 -0000)
svn path=/trunk/mcs/; revision=39439

mcs/gmcs/AssemblyInfo.cs
mcs/gmcs/ChangeLog
mcs/gmcs/assign.cs
mcs/gmcs/attribute.cs
mcs/gmcs/class.cs
mcs/gmcs/driver.cs
mcs/gmcs/ecore.cs
mcs/gmcs/expression.cs
mcs/gmcs/parameter.cs

index c442f03ee4ed364e3a92884c1c511eef4e3d6ee5..8275cebbcb161304528011dad83b1966fcb29227 100644 (file)
@@ -1,7 +1,7 @@
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
-[assembly: AssemblyVersion("1.1.2")]
+[assembly: AssemblyVersion("1.1.3")]
 [assembly: AssemblyTitle ("Mono C# Compiler")]
 [assembly: AssemblyDescription ("Mono C# Compiler with Generics")]
 [assembly: AssemblyCopyright ("2001, 2002, 2003 Ximian, Inc.")]
index f75fc6e068d815a77c18d005a469fee3533d373b..6705c0fb12d6b22203b7d15c698342fbefbed58a 100644 (file)
@@ -1,3 +1,26 @@
+2004-12-08  Martin Baulig  <martin@ximian.com>
+
+       * decl.cs (MemberName.ToString): Make this work again.
+
+2004-12-08  Marek Safar  <marek.safar@seznam.cz>
+
+       * attribute.cs (Resolve): Add error 591 detection.
+
+       * class.cs (FieldMember.Define): Add error 1547 detection.
+       (Indexer.Define): Add error 620 detection.
+       (Operator.Define): Add error 590 detection.
+
+       * ecore.cs: Missing argument for error 79.
+
+       * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
+       detection.
+
+2004-12-07  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #70106
+       * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
+       only.
+
 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
 
        * cs-parser.jay : handle doc comments on implicit/explicit operators.
index 6c5c87d56eaf29f739501bbd4e7ddb50550d745c..3c009e625f8c9561e313082b39f64cdeae7d84f5 100644 (file)
@@ -388,7 +388,7 @@ namespace Mono.CSharp {
                        }
 
                        FieldExpr field_exp = target as FieldExpr;
-                       if (field_exp != null && !ec.IsConstructor && !ec.IsFieldInitializer) {
+                       if (field_exp != null && field_exp.DeclaringType.IsValueType && !ec.IsConstructor && !ec.IsFieldInitializer) {
                                field_exp = field_exp.InstanceExpression as FieldExpr;
                                if (field_exp != null && field_exp.FieldInfo.IsInitOnly) {
                                        if (field_exp.IsStatic) {
index 0582fb81efcae41c5d8af2858e922195c6791f7f..29ccc7e14556ff012aeb4fb85419f497d61edbfc 100644 (file)
@@ -348,6 +348,10 @@ namespace Mono.CSharp {
 
                                if (DoCompares){
                                        if (usage_attr) {
+                                               if ((int)val == 0) {
+                                                       Report.Error (591, Location, "Invalid value for argument to 'System.AttributeUsage' attribute");
+                                                       return null;
+                                               }
                                                usage_attribute = new AttributeUsageAttribute ((AttributeTargets)val);
                                        } else if (MethodImplAttr) {
                                                this.ImplOptions = (MethodImplOptions) val;
index eaf78dbcf9629c90f780e9f7f322bf524a9559c6..2bdffad870b979f9b6589dddd6847cef8b5ebdaa 100644 (file)
@@ -5629,6 +5629,13 @@ namespace Mono.CSharp {
                        
                        MemberType = texpr.Type;
 
+                       if (MemberType == TypeManager.void_type) {
+                               Report.Error (1547, Location, "Keyword 'void' cannot be used in this context");
+                               return false;
+                       }
+
+                       ec.InUnsafe = old_unsafe;
+
                        if (!CheckBase ())
                                return false;
                        
@@ -7229,6 +7236,11 @@ namespace Mono.CSharp {
                        if (!base.Define ())
                                return false;
 
+                       if (MemberType == TypeManager.void_type) {
+                               Report.Error (620, Location, "Indexers cannot have void type");
+                               return false;
+                       }
+
                        if (OptAttributes != null) {
                                Attribute indexer_attr = OptAttributes.Search (TypeManager.indexer_name_type, ec);
                                if (indexer_attr != null) {
@@ -7466,6 +7478,11 @@ namespace Mono.CSharp {
                        if (!DoDefine (ds))
                                return false;
 
+                       if (MemberType == TypeManager.void_type) {
+                               Report.Error (590, Location, "User-defined operators cannot return void");
+                               return false;
+                       }
+
                        OperatorMethod = new Method (
                                Parent, null, Type, ModFlags, false, MemberName,
                                Parameters, OptAttributes, Location);
index eb8e485fafb177b0dcc088719b12e97faef00276..b471d3ffc33bc5989bea1b214542e8e1775c90f3 100644 (file)
@@ -20,7 +20,6 @@ namespace Mono.CSharp
        using System.Text;
        using System.Globalization;
        using System.Xml;
-       using System.Diagnostics;
 
        public enum Target {
                Library, Exe, Module, WinExe
@@ -63,7 +62,6 @@ namespace Mono.CSharp
                static bool timestamps = false;
                static bool pause = false;
                static bool show_counters = false;
-               public static bool parser_verbose = false;
                
                //
                // Whether to load the initial config file (what CSC.RSP has by default)
index 87e2815a583a986c3a826bab8902b6b1c8de0c62..311789943f167f89b3f2773df2be925d2aaa2eed 100644 (file)
@@ -3721,7 +3721,7 @@ namespace Mono.CSharp {
                public override void Emit (EmitContext ec)
                {
                        if (instance_expr is This)
-                               Report.Error (79, loc, "The event `{0}' can only appear on the left hand side of += or -=, try calling the actual delegate");
+                               Report.Error (79, loc, "The event `{0}' can only appear on the left hand side of += or -=, try calling the actual delegate", Name);
                        else
                                Report.Error (70, loc, "The event `{0}' can only appear on the left hand side of += or -= "+
                                              "(except on the defining type)", Name);
index a05692972cacad188a0cbcb98563d01243bb9c74..0da5f0ba92ba267ca4e55c52ff10292d0595b569 100644 (file)
@@ -8871,6 +8871,12 @@ namespace Mono.CSharp {
                                UnsafeError (loc);
                                return null;
                        }
+
+                       if (type.IsArray && (type.GetElementType () == TypeManager.arg_iterator_type ||
+                               type.GetElementType () == TypeManager.typed_reference_type)) {
+                               Report.Error (611, loc, "Array elements cannot be of type '{0}'", TypeManager.CSharpName (type.GetElementType ()));
+                               return null;
+                       }
                        
                        eclass = ExprClass.Type;
                        return this;
index 2bd627775a4b1c87fa27b15418b22a235066dcf9..0af412acc2c12e8cc0ed4966c0ce6b6fdc39d4d8 100644 (file)
@@ -183,7 +183,7 @@ namespace Mono.CSharp {
                        }
 
                        if (parameter_type == TypeManager.void_type){
-                               Report.Error (1536, l, "`void' parameter is not permitted");
+                               Report.Error (1536, l, "Invalid parameter type 'void'");
                                return false;
                        }