Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

ParserError with DataRowVersion #517

@wilsade

Description

@wilsade

Hi there.

I've got a parser error when parsing this code:

` [TestMethod]
public void WhenParsingThisCodeReturnNoError()
{
const string sampleCode = @"
using System.Data;
namespace Test
{
public class TestClass
{
void TestMethod()
{
DataRow row = null;

  row[""AnyField""] = row.RowState == DataRowState.Deleted ? 
    row[""OtherField"", DataRowVersion.Original] : 
    row[""SomeField""];
}

}
}";
var parser = new ICSharpCode.NRefactory.CSharp.CSharpParser();
var syntaxTree = parser.Parse(sampleCode);
Assert.IsTrue(syntaxTree.Errors.Count == 0, "Parser error");
}`

If I remove the DataRowVersion, the parse is OK:

row[""AnyField""] = row.RowState == DataRowState.Deleted ?
row[""OtherField""] :
row[""SomeField""];

Thanks,
Wilsade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions