Permalink
Browse files

Updated mcs & added unit test.

  • Loading branch information...
1 parent 670975c commit 381334489e405c25d8c2126950ee89b1cbf253f5 @mkrueger mkrueger committed Mar 1, 2012
@@ -751,6 +751,9 @@ protected virtual void Error_NegativeArrayIndex (ResolveContext ec, Location loc
public virtual void Error_OperatorCannotBeApplied (ResolveContext rc, Location loc, string oper, TypeSpec t)
{
+ if (t == InternalType.ErrorType)
+ return;
+
rc.Report.Error (23, loc, "The `{0}' operator cannot be applied to operand of type `{1}'",
oper, t.GetSignatureForError ());
}
@@ -4728,7 +4731,7 @@ public MethodSpec ResolveOperator (ResolveContext rc, ref Arguments args)
} else if (IsDelegateInvoke) {
ec.Report.Error (1594, loc, "Delegate `{0}' has some invalid arguments",
DelegateType.GetSignatureForError ());
- } else {
+ } else if (a.Type != InternalType.ErrorType) {
ec.Report.SymbolRelatedToPreviousError (method);
ec.Report.Error (1502, loc, "The best overloaded method match for `{0}' has some invalid arguments",
method.GetSignatureForError ());
@@ -4745,7 +4748,7 @@ public MethodSpec ResolveOperator (ResolveContext rc, ref Arguments args)
else
ec.Report.Error (1620, loc, "Argument `#{0}' is missing `{1}' modifier",
index, Parameter.GetModifierSignature (mod));
- } else if (a.Expr != ErrorExpression.Instance) {
+ } else if (a.Type != InternalType.ErrorType) {
string p1 = a.GetSignatureForError ();
string p2 = TypeManager.CSharpName (paramType);
@@ -8422,8 +8422,11 @@ Expression CreateAccessExpression (ResolveContext ec)
return new IndexerExpr (indexers, type, this);
}
- ec.Report.Error (21, loc, "Cannot apply indexing with [] to an expression of type `{0}'",
- type.GetSignatureForError ());
+ if (type != InternalType.ErrorType) {
+ ec.Report.Error (21, loc, "Cannot apply indexing with [] to an expression of type `{0}'",
+ type.GetSignatureForError ());
+ }
+
return null;
}
@@ -4579,6 +4579,24 @@ public static void Main (string[] args)
Assert.IsNotNull (provider.Find ("Math"), "'Math' not found.");
}
+ [Ignore("Mcs bug")]
+ [Test()]
+ public void TestConditionalExpression ()
+ {
+ CompletionDataList provider = CreateProvider (
+@"using System;
+
+class MainClass
+{
+ public static void Main (string[] args)
+ {
+ int a;
+ $a = true ? System.$
+ }
+}
+");
+ Assert.IsNotNull (provider.Find ("Math"), "'Math' not found.");
+ }
/// <summary>
/// Bug 3655 - Autocompletion does not work for the assembly attribute [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("MyExternalAssembly")]

0 comments on commit 3813344

Please sign in to comment.