The type of 'this' is 'Implementation', and in F#, you need to explicitly upcast to interfaces to call interface members:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
type InterfaceA =
    abstract Evaluate : unit -> double 

 

type InterfaceB = 
    inherit InterfaceA 
    abstract Value : double 

 

type Implementation(v) =
    interface InterfaceB with
        member this.Value = v 

        member this.Evaluate() = (this :> InterfaceB).Value 
By on 6/7/2011 10:51 AM ()

Thanks!!!

By on 6/7/2011 10:53 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper