hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

Can't call a particular protected method in a C# class

Last post 05-17-2008, 4:33 by olivers. 1 replies.
Sort Posts: Previous Next
  •  05-16-2008, 13:57 5933

    Can't call a particular protected method in a C# class

    I have a class in C# with a method with the following signature:

      protected virtual void OnChanged(string propertyName, object oldValue, object newValue) ...

    In F#, I derive a class from that class (not directly, there are other classes in between) and implement a new member that calls this method:

        member public x.SetPropertyValueFS propertyName oldVal newVal = 
            x.OnChanged(propertyName, !oldVal, newVal)

    When I try to compile, I get this error message: Error 5 A protected member is called or a base variable is being used. This is currently only allowed in the direct implementation of members since they could escape their object scope.

    I can't find any reference to that error message anywhere. What does it mean? I've done tests with other calls into protected virtual methods and they work just fine.

    Thanks
    Oliver

  •  05-17-2008, 4:33 5941 in reply to 5933

    Re: Can't call a particular protected method in a C# class

    This problem was solved with help from Brian McNamara, although the precise reason for the error message still remains unclear. If you're interested in the solution, please see my blog post here: http://www.sturmnet.org/blog/archives/2008/05/16/oddities-in-fc-interaction/

     

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems