Fix #80530
authorRaja R Harinath <harinath@hurrynot.org>
Sat, 27 Jan 2007 18:11:23 +0000 (18:11 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Sat, 27 Jan 2007 18:11:23 +0000 (18:11 -0000)
* expression.cs (Error_InvalidArguments): Don't use two different
messages for CS1503.  Use ExtraInformation and
SymbolRelatedToPreviousError instead.

svn path=/trunk/mcs/; revision=71792

mcs/mcs/ChangeLog
mcs/mcs/expression.cs

index 0fc7a557aaab5c1ec529ffc5678f59724ece8141..d106bbcfa8abbbb597ebc5899131da3660a775e1 100644 (file)
@@ -1,5 +1,10 @@
 2007-01-27  Raja R Harinath  <rharinath@novell.com>
 
+       Fix #80530
+       * expression.cs (Error_InvalidArguments): Don't use two different
+       messages for CS1503.  Use ExtraInformation and
+       SymbolRelatedToPreviousError instead.
+
        Fix #80358
        * decl.cs (DeclSpace.initialize_type_params): Don't access
        'type_params' of a partial class directly.
index c535d48e6d88d5cd4f7b27806f34224e902455eb..28d32c34362fa486a64e493282c2af55c6a79867 100644 (file)
@@ -4852,20 +4852,13 @@ namespace Mono.CSharp {
                                string p1 = Argument.FullDesc (a);
                                string p2 = expected_par.ParameterDesc (idx);
 
-                               //
-                               // The parameter names are the same, most likely they come from different
-                               // assemblies.
-                               //
-                               if (p1 == p2){
-                                       Report.Error (1503, loc,
-                                                     "Argument {0}: Cannot conver from equally named types from different " +
-                                                     "assemblies {0} (from {1}) and {2} (from {3})",
-                                                     p1, a.Expr.Type.Assembly.FullName, p2,
-                                                     expected_par.ParameterType (idx).Assembly.FullName);
-                               } else
-                                       Report.Error (1503, loc, "Argument {0}: Cannot convert from `{1}' to `{2}'",
-                                                     index, p1, p2);
+                               if (p1 == p2) {
+                                       Report.ExtraInformation (loc, "(equally named types possibly from different assemblies in previous ");
+                                       Report.SymbolRelatedToPreviousError (a.Expr.Type);
+                                       Report.SymbolRelatedToPreviousError (expected_par.ParameterType (idx));
                                }
+                               Report.Error (1503, loc, "Argument {0}: Cannot convert from `{1}' to `{2}'", index, p1, p2);
+                       }
                }
                
                public static bool VerifyArgumentsCompat (EmitContext ec, ArrayList Arguments,