Browse Source

Updated mcs & added unit test.

newNRvisualizers
Mike Krüger 14 years ago
parent
commit
381334489e
  1. 7
      ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs
  2. 7
      ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs
  3. 18
      ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs

7
ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs

@ -751,6 +751,9 @@ namespace Mono.CSharp { @@ -751,6 +751,9 @@ namespace Mono.CSharp {
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 @@ namespace Mono.CSharp { @@ -4728,7 +4731,7 @@ namespace Mono.CSharp {
} 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 @@ namespace Mono.CSharp { @@ -4745,7 +4748,7 @@ namespace Mono.CSharp {
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);

7
ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs

@ -8422,8 +8422,11 @@ namespace Mono.CSharp @@ -8422,8 +8422,11 @@ namespace Mono.CSharp
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;
}

18
ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs

@ -4579,6 +4579,24 @@ class MainClass @@ -4579,6 +4579,24 @@ class MainClass
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")]

Loading…
Cancel
Save