From 3742361e5827f9a2feb0bb3f740e2bce20c27507 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 15 Mar 2012 09:04:54 +0000 Subject: [PATCH] Less cascading errors --- mcs/mcs/ecore.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs index 623b38c6c55..bcdb814d808 100644 --- a/mcs/mcs/ecore.cs +++ b/mcs/mcs/ecore.cs @@ -4737,6 +4737,9 @@ namespace Mono.CSharp { if (custom_errors != null && custom_errors.ArgumentMismatch (ec, method, a, idx)) return; + if (a.Type == InternalType.ErrorType) + return; + if (a is CollectionElementInitializer.ElementInitializerArgument) { ec.Report.SymbolRelatedToPreviousError (method); if ((expected_par.FixedParameters[idx].ModFlags & Parameter.Modifier.RefOutMask) != 0) { @@ -4749,7 +4752,7 @@ namespace Mono.CSharp { } else if (IsDelegateInvoke) { ec.Report.Error (1594, loc, "Delegate `{0}' has some invalid arguments", DelegateType.GetSignatureForError ()); - } else if (a.Type != InternalType.ErrorType) { + } else { ec.Report.SymbolRelatedToPreviousError (method); ec.Report.Error (1502, loc, "The best overloaded method match for `{0}' has some invalid arguments", method.GetSignatureForError ()); @@ -4765,7 +4768,7 @@ namespace Mono.CSharp { else ec.Report.Error (1620, loc, "Argument `#{0}' is missing `{1}' modifier", index, Parameter.GetModifierSignature (mod)); - } else if (a.Type != InternalType.ErrorType) { + } else { string p1 = a.GetSignatureForError (); string p2 = TypeManager.CSharpName (paramType); -- 2.11.4.GIT