3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Bugs/ParserBugTests.cs
/// <summary>
/// Bug 4252 - override bug in mcs ast
/// </summary>
Bug 4252 - override bug in mcs ast
Bug 4252 - override bug in mcs ast
[Test]
		public void TestBug4252()
		{
			string code = @"
class Foo
{
    class Bar
    {
          override foo
    }
    public Foo () 
    {
    }
}";
			var unit = SyntaxTree.Parse(code);
			var type = unit.Members.First() as TypeDeclaration;
			var constructor = type.Members.Skip(1).First() as ConstructorDeclaration;
			var passed = !constructor.HasModifier(Modifiers.Override);
			if (!passed) {
				Console.WriteLine("Expected:" + code);
				Console.WriteLine("Was:" + unit);
			}
			Assert.IsTrue(passed);
		}
[ Test ] public void TestBug4252 ( ) { string code = @"
class Foo
{

    class Bar
    {
          override foo
    }

    public Foo () 
    {
    }
}" ; var unit = SyntaxTree . Parse ( code ) ; var type = unit . Members . First ( ) as TypeDeclaration ; var constructor = type . Members . Skip ( 1 ) . First ( ) as ConstructorDeclaration ; var passed = ! constructor . HasModifier ( Modifiers . Override ) ; if ( ! passed ) { Console . WriteLine ( " " + code ) ; Console . WriteLine ( " " + unit ) ; } Assert . IsTrue ( passed ) ; }
Bug 4252 - override bug in mcs ast
Bug 4252 - override bug in mcs ast