Author: marek
Date: 2005-11-07 04:04:45 -0500 (Mon, 07 Nov 2005)
New Revision: 52640
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/class.cs
trunk/mcs/mcs/delegate.cs
trunk/mcs/mcs/ecore.cs
trunk/mcs/mcs/enum.cs
trunk/mcs/mcs/expression.cs
trunk/mcs/mcs/typemanager.cs
Log:
2005-11-07 Marek Safar <[EMAIL PROTECTED]>
* class.cs (CheckPairedOperators): Made compilable with csc 2.0.
* ecore.cs (InstanceResolve): Fixed CS1540 detection.
* expression.cs (Binary.DoResolve): Added && optimalization.
* typemanager.cs (AddUserType): Removed useless argument.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2005-11-07 08:57:59 UTC (rev 52639)
+++ trunk/mcs/mcs/ChangeLog 2005-11-07 09:04:45 UTC (rev 52640)
@@ -1,6 +1,16 @@
+2005-11-07 Marek Safar <[EMAIL PROTECTED]>
+
+ * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
+
+ * ecore.cs (InstanceResolve): Fixed CS1540 detection.
+
+ * expression.cs (Binary.DoResolve): Added && optimalization.
+
+ * typemanager.cs (AddUserType): Removed useless argument.
+
2005-11-04 Marek Safar <[EMAIL PROTECTED]>
- * statement.cs (Block.variables): Uses ListDictionary.
+ * statement.cs (Block.variables): Uses ListDictionary.
2005-11-03 Marek Safar <[EMAIL PROTECTED]>
Modified: trunk/mcs/mcs/class.cs
===================================================================
--- trunk/mcs/mcs/class.cs 2005-11-07 08:57:59 UTC (rev 52639)
+++ trunk/mcs/mcs/class.cs 2005-11-07 09:04:45 UTC (rev 52640)
@@ -270,7 +270,7 @@
//
void CheckPairedOperators ()
{
- Hashtable pairs = new Hashtable (null, null);
+ IDictionary pairs = new HybridDictionary ();
Operator true_op = null;
Operator false_op = null;
bool has_equality_or_inequality = false;
@@ -1208,7 +1208,7 @@
return null;
}
- TypeManager.AddUserType (Name, this);
+ TypeManager.AddUserType (this);
if (Parts != null) {
ec = null;
Modified: trunk/mcs/mcs/delegate.cs
===================================================================
--- trunk/mcs/mcs/delegate.cs 2005-11-07 08:57:59 UTC (rev 52639)
+++ trunk/mcs/mcs/delegate.cs 2005-11-07 09:04:45 UTC (rev 52640)
@@ -106,7 +106,7 @@
name, TypeAttr,
TypeManager.multicast_delegate_type);
}
- TypeManager.AddUserType (Name, this);
+ TypeManager.AddUserType (this);
return TypeBuilder;
}
Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs 2005-11-07 08:57:59 UTC (rev 52639)
+++ trunk/mcs/mcs/ecore.cs 2005-11-07 09:04:45 UTC (rev 52640)
@@ -267,6 +267,16 @@
Report.Error (122, loc, "`{0}' is inaccessible due to
its protection level", name);
}
+ protected static void Error_CannotAccessProtected (Location
loc, MemberInfo m, Type qualifier, Type container)
+ {
+ Report.Error (1540, loc, "Cannot access protected
member `{0}' via a qualifier of type `{1}';"
+ + " the qualifier must be of type `{2}' (or
derived from it)",
+ TypeManager.GetFullNameSignature (m),
+ TypeManager.CSharpName (qualifier),
+ TypeManager.CSharpName (container));
+
+ }
+
public virtual void Error_ValueCannotBeConverted (Location loc,
Type target, bool expl)
{
if (Type.Name == target.Name){
@@ -725,12 +735,7 @@
// base class (CS1540). If the
qualifier_type is a base of the
// ec.ContainerType and the
lookup succeeds with the latter one,
// then we are in this
situation.
- Report.Error (1540, loc,
- "Cannot access
protected member `{0}' via a qualifier of type `{1}';"
- + " the qualifier
must be of type `{2}' (or derived from it)",
-
TypeManager.GetFullNameSignature (m),
-
TypeManager.CSharpName (qualifier_type),
-
TypeManager.CSharpName (ec.ContainerType));
+ Error_CannotAccessProtected
(loc, m, qualifier_type, ec.ContainerType);
} else {
ErrorIsInaccesible (loc,
TypeManager.GetFullNameSignature (m));
}
@@ -3217,18 +3222,12 @@
InstanceExpression.CheckMarshallByRefAccess
(ec.ContainerType);
- if (must_do_cs1540_check && InstanceExpression !=
EmptyExpression.Null) {
- if ((InstanceExpression.Type !=
ec.ContainerType) &&
- ec.ContainerType.IsSubclassOf
(InstanceExpression.Type)) {
- Report.Error (1540, loc, "Cannot access
protected member `" +
-
PropertyInfo.DeclaringType + "." + PropertyInfo.Name +
- "' via a qualifier of
type `" +
- TypeManager.CSharpName
(InstanceExpression.Type) +
- "'; the qualifier must be
of type `" +
- TypeManager.CSharpName
(ec.ContainerType) +
- "' (or derived from it)");
+ if (must_do_cs1540_check && InstanceExpression !=
EmptyExpression.Null &&
+ InstanceExpression.Type != ec.ContainerType &&
+ ec.ContainerType.IsSubclassOf
(PropertyInfo.DeclaringType) &&
+ InstanceExpression.Type.IsSubclassOf
(PropertyInfo.DeclaringType)) {
+ Error_CannotAccessProtected (loc,
PropertyInfo, InstanceExpression.Type, ec.ContainerType);
return false;
- }
}
return true;
Modified: trunk/mcs/mcs/enum.cs
===================================================================
--- trunk/mcs/mcs/enum.cs 2005-11-07 08:57:59 UTC (rev 52639)
+++ trunk/mcs/mcs/enum.cs 2005-11-07 09:04:45 UTC (rev 52640)
@@ -291,7 +291,7 @@
FieldAttributes.Public |
FieldAttributes.SpecialName
|
FieldAttributes.RTSpecialName);
- TypeManager.AddUserType (Name, this);
+ TypeManager.AddUserType (this);
foreach (EnumMember em in defined_names.Values) {
if (!em.Define ())
Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2005-11-07 08:57:59 UTC (rev 52639)
+++ trunk/mcs/mcs/expression.cs 2005-11-07 09:04:45 UTC (rev 52640)
@@ -2373,6 +2373,11 @@
if (rc is EnumConstant &&
lc != null && lc.IsZeroInteger)
return rc;
+ } else if (oper == Operator.LogicalAnd) {
+ if (rc != null && rc.IsDefaultValue && rc.Type
== TypeManager.bool_type)
+ return rc;
+ if (lc != null && lc.IsDefaultValue && lc.Type
== TypeManager.bool_type)
+ return lc;
}
if (rc != null && lc != null){
Modified: trunk/mcs/mcs/typemanager.cs
===================================================================
--- trunk/mcs/mcs/typemanager.cs 2005-11-07 08:57:59 UTC (rev 52639)
+++ trunk/mcs/mcs/typemanager.cs 2005-11-07 09:04:45 UTC (rev 52640)
@@ -379,7 +379,7 @@
type_hash = new DoubleHash ();
}
- public static void AddUserType (string name, DeclSpace ds)
+ public static void AddUserType (DeclSpace ds)
{
builder_to_declspace.Add (ds.TypeBuilder, ds);
}
@@ -1138,7 +1138,7 @@
// a TypeBuilder array will return a Type, not a TypeBuilder,
// and we can not call FindMembers on this type.
//
- if (t.IsSubclassOf (TypeManager.array_type))
+ if (TypeManager.IsSubclassOf (t, TypeManager.array_type))
return new MemberList
(TypeManager.array_type.FindMembers (mt, bf, filter, criteria));
//
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches