SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Explicit interface member handled incorrectly in ICSharpCode.NRefactory.IParser

Last post 04-18-2008 12:23 AM by EatenByAGrue. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-17-2008 11:15 PM

    Explicit interface member handled incorrectly in ICSharpCode.NRefactory.IParser

     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

  • 04-17-2008 11:33 PM In reply to

    Re: Explicit interface member handled incorrectly in ICSharpCode.NRefactory.IParser

    NRefactory is not a compiler, what exactly do you mean with "preventing it from being able to compile"?

    The explicit interface implementation should be stored in PropertyDeclaration.InterfaceImplementations. 

    Daniel Grunwald
  • 04-18-2008 12:14 AM In reply to

    Re: Explicit interface member handled incorrectly in ICSharpCode.NRefactory.IParser

    Sorry, I left out a bit of detail.  I'm rebuilding the C# code from the parser.  The resulting duplicate values create a compile issue, but that's more my problem than the parser's :)  The real trouble is the duplicate Name values created by the parser instead of two, distinct Name values.

  • 04-18-2008 12:23 AM In reply to

    Re: Explicit interface member handled incorrectly in ICSharpCode.NRefactory.IParser

    I just checked that PropertyDeclaration.InterfaceImplementations value.  Indeed, that is where it is stored.  Nuts, and here I was thinking I was helping out by reporting a bug, but instead I just made more work for you.  Sorry!

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.