From: Martin Baulig Date: Mon, 24 Jan 2005 23:39:23 +0000 (-0000) Subject: **** Merged r37312-r37380 from MCS **** X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=38d68268fab1d22a0e6daa425e7b3e027b4c66be;p=mono.git **** Merged r37312-r37380 from MCS **** svn path=/trunk/mcs/; revision=39439 --- diff --git a/mcs/gmcs/AssemblyInfo.cs b/mcs/gmcs/AssemblyInfo.cs index c442f03ee4e..8275cebbcb1 100644 --- a/mcs/gmcs/AssemblyInfo.cs +++ b/mcs/gmcs/AssemblyInfo.cs @@ -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.")] diff --git a/mcs/gmcs/ChangeLog b/mcs/gmcs/ChangeLog index f75fc6e068d..6705c0fb12d 100644 --- a/mcs/gmcs/ChangeLog +++ b/mcs/gmcs/ChangeLog @@ -1,3 +1,26 @@ +2004-12-08 Martin Baulig + + * decl.cs (MemberName.ToString): Make this work again. + +2004-12-08 Marek Safar + + * 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 + + Fix #70106 + * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types + only. + 2004-12-07 Atsushi Enomoto * cs-parser.jay : handle doc comments on implicit/explicit operators. diff --git a/mcs/gmcs/assign.cs b/mcs/gmcs/assign.cs index 6c5c87d56ea..3c009e625f8 100644 --- a/mcs/gmcs/assign.cs +++ b/mcs/gmcs/assign.cs @@ -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) { diff --git a/mcs/gmcs/attribute.cs b/mcs/gmcs/attribute.cs index 0582fb81efc..29ccc7e1455 100644 --- a/mcs/gmcs/attribute.cs +++ b/mcs/gmcs/attribute.cs @@ -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; diff --git a/mcs/gmcs/class.cs b/mcs/gmcs/class.cs index eaf78dbcf96..2bdffad870b 100644 --- a/mcs/gmcs/class.cs +++ b/mcs/gmcs/class.cs @@ -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); diff --git a/mcs/gmcs/driver.cs b/mcs/gmcs/driver.cs index eb8e485fafb..b471d3ffc33 100644 --- a/mcs/gmcs/driver.cs +++ b/mcs/gmcs/driver.cs @@ -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) diff --git a/mcs/gmcs/ecore.cs b/mcs/gmcs/ecore.cs index 87e2815a583..311789943f1 100644 --- a/mcs/gmcs/ecore.cs +++ b/mcs/gmcs/ecore.cs @@ -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); diff --git a/mcs/gmcs/expression.cs b/mcs/gmcs/expression.cs index a05692972ca..0da5f0ba92b 100644 --- a/mcs/gmcs/expression.cs +++ b/mcs/gmcs/expression.cs @@ -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; diff --git a/mcs/gmcs/parameter.cs b/mcs/gmcs/parameter.cs index 2bd627775a4..0af412acc2c 100644 --- a/mcs/gmcs/parameter.cs +++ b/mcs/gmcs/parameter.cs @@ -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; }