I created a parser:
ParserFactory.CreateParser(SupportedLanguage.CSharp, new StringReader(content))
"content" is a valid C# file and includes the following code:
public Activity Activity {
get {
if(activity.IsNew) {
this.activity = Activity.GetInstance(this.ActivityId);
}
return this.activity as Activity;
}
}
IActivity IEventActivity.Activity {
get {
return this.Activity;
}
}
The bug is that both Activity and IEventActivity.Activity are created as Children of the same INode -- PropertyDeclaration objects with the Name set to "Activity", thus losing the explicit interface "IEventActivity" from the second property. Not to mention that the resulting code now has 2 Activity properties, preventing it from being able to compile.
I replicated this problem with both ICSharpCode.NRefactory.dll version 3.0.0.2871 and 3.0.0.2970