Author: duncan
Date: 2005-03-07 23:40:02 -0500 (Mon, 07 Mar 2005)
New Revision: 41545

Modified:
   trunk/mcs/mcs/convert.cs
   trunk/mcs/mcs/cs-tokenizer.cs
   trunk/mcs/mcs/expression.cs
Log:
Revert my unfinished patches that were accidentally committed

Modified: trunk/mcs/mcs/convert.cs
===================================================================
--- trunk/mcs/mcs/convert.cs    2005-03-08 04:12:16 UTC (rev 41544)
+++ trunk/mcs/mcs/convert.cs    2005-03-08 04:40:02 UTC (rev 41545)
@@ -1036,27 +1036,20 @@
                        if (method == null || count > 1)
                                return null;
                        
-                       Expression original_source = source;
+                       
                        //
                        // This will do the conversion to the best match that we
-                       // found.  Now we need to perform an implicit standard 
conversion
+                       // found.  Now we need to perform an implict standard 
conversion
                        // if the best match was not the type that we were 
requested
                        // by target.
                        //
                        if (look_for_explicit)
-                               source = ExplicitConversionStandard (ec, 
original_source, most_specific_source, loc);
+                               source = ExplicitConversionStandard (ec, 
source, most_specific_source, loc);
                        else
-                               source = ImplicitConversionStandard (ec, 
original_source, most_specific_source, loc);
+                               source = ImplicitConversionStandard (ec, 
source, most_specific_source, loc);
 
-                       //
-                       // If ImplicitConversionStandard comes up with nothing, 
try UserDefinedConversion 
-                       // again, because a UserCast might be able to cast 
`original_source' into `most_specific_source'.
-                       //
-                       if (source == null) {
-                               source = UserDefinedConversion (ec, 
original_source, most_specific_source, loc, false);
-                               if (source == null)
-                                       return null;
-                       }
+                       if (source == null)
+                               return null;
 
                        Expression e;
                        e =  new UserCast ((MethodInfo) method, source, loc);

Modified: trunk/mcs/mcs/cs-tokenizer.cs
===================================================================
--- trunk/mcs/mcs/cs-tokenizer.cs       2005-03-08 04:12:16 UTC (rev 41544)
+++ trunk/mcs/mcs/cs-tokenizer.cs       2005-03-08 04:40:02 UTC (rev 41545)
@@ -1947,14 +1947,11 @@
                                        } else if (d == '*'){
                                                getChar ();
                                                bool docAppend = false;
-                                               bool expecting_end_of_comment = 
true;
-                                               
                                                if (RootContext.Documentation 
!= null && peekChar () == '*') {
                                                        getChar ();
                                                        // But when it is /**/, 
just do nothing.
                                                        if (peekChar () == '/') 
{
                                                                getChar ();
-                                                               
expecting_end_of_comment = false;
                                                                continue;
                                                        }
                                                        if (doc_state == 
XmlCommentState.Allowed)
@@ -1976,7 +1973,6 @@
                                                                getChar ();
                                                                col++;
                                                                comments_seen = 
true;
-                                                               
expecting_end_of_comment = false;
                                                                break;
                                                        }
                                                        if (docAppend)
@@ -2000,10 +1996,6 @@
 
                                                if (docAppend)
                                                        
update_formatted_doc_comment (current_comment_start);
-
-                                               if (expecting_end_of_comment)
-                                                       Report.Error (1035, 
Location, "End-of-file found, '*/' expected");
-                                               
                                                continue;
                                        }
                                        goto is_punct_label;

Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2005-03-08 04:12:16 UTC (rev 41544)
+++ trunk/mcs/mcs/expression.cs 2005-03-08 04:40:02 UTC (rev 41545)
@@ -2400,6 +2400,9 @@
 
                                        if (l == r)
                                                return this;
+                                       
+                                       if (l.IsSubclassOf (r) || 
r.IsSubclassOf (l))
+                                               return this;
 
                                        //
                                        // Also, a standard conversion must 
exist from either one
@@ -2418,17 +2421,9 @@
                                                right = new EmptyCast (right, 
TypeManager.object_type);
 
                                        //
-                                       // Report CS0252 / CS0253 if we have to 
invoke Object.op_Equality
-                                       // even when either l or r implements 
of op_Equality.
-                                       // 
-                                       if (!HasEqualityOperatorForType (l, r))
-                                               
Warning_UnintendedReferenceComparison (loc, "right", r.FullName);
-                                       
-                                       else if (!HasEqualityOperatorForType 
(r, l))
-                                               
Warning_UnintendedReferenceComparison (loc, "left", l.FullName);
-
-                                       if (l.IsSubclassOf (r) || 
r.IsSubclassOf (l))
-                                               return this;
+                                       // FIXME: CSC here catches errors cs254 
and cs252
+                                       //
+                                       return this;
                                }
 
                                //
@@ -2698,29 +2693,6 @@
                        return this;
                }
 
-               // Checks whether or not 'container' has op_Equality that can 
handle 'comparison_type'.
-               public static bool HasEqualityOperatorForType (Type container, 
Type comparison_type)
-               {
-                       // Can't call GetMethod here as there could be multiple 
impl. of op_Equality.
-                       MethodInfo [] methods = container.GetMethods ();
-                       foreach (MethodInfo m in methods) {
-                               if (m.Name == "op_Equality") {
-                                       foreach (ParameterInfo param in 
m.GetParameters ()) {
-                                               if (param.ParameterType == 
comparison_type)
-                                                       return true;
-                                       }
-                               }
-                       }
-                       return false;
-               }
-
-               public static void Warning_UnintendedReferenceComparison 
(Location loc, string direction, string type_name)
-               {
-                       Report.Warning ((direction == "left" ? 252 : 253), 2, 
loc,
-                                       "Possible unintended reference 
comparison; to get a value comparison, " +
-                                       "cast the " + direction + " hand side 
to type " + type_name + ".");
-               }
-
                public override Expression DoResolve (EmitContext ec)
                {
                        if ((oper == Operator.Subtraction) && (left is 
ParenthesizedExpression)) {

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

Reply via email to