Browse Source

Fixed issue in semantic highlighting type errors

pull/32/merge
Mike Krüger 13 years ago
parent
commit
f3537813b6
  1. 4
      ICSharpCode.NRefactory.CSharp/Analysis/SemanticHighlightingVisitor.cs
  2. 16
      ICSharpCode.NRefactory.Tests/CSharp/Analysis/SemanticHighlightingTests.cs

4
ICSharpCode.NRefactory.CSharp/Analysis/SemanticHighlightingVisitor.cs

@ -514,6 +514,10 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis
case TypeKind.Delegate: case TypeKind.Delegate:
color = delegateTypeColor; color = delegateTypeColor;
return true; return true;
case TypeKind.Unknown:
case TypeKind.Null:
color = syntaxErrorColor;
return true;
default: default:
color = default (TColor); color = default (TColor);
return false; return false;

16
ICSharpCode.NRefactory.Tests/CSharp/Analysis/SemanticHighlightingTests.cs

@ -303,6 +303,22 @@ class Class {
TestColor (code, syntaxErrorColor); TestColor (code, syntaxErrorColor);
} }
[Test]
public void TestNullTypeError()
{
string code =@"
class A
{
public static void Main ()
{
$var a = null;
}
}
";
TestColor (code, syntaxErrorColor);
}
} }

Loading…
Cancel
Save