F# access protected field from a C# inherited class -


i have class in c# looks this:

class {     protected someclass field; }  class b: {} 

and following code in f#:

type c() =     inherit b()      member this.somemethod() =         let magic() = base.field.somemoremagic(someparam) //this.field fails         ... 

in want access protected field field. know access protected fields class b simple type base.something (which answered here) when type base.field access protected field class a error struct or class field not accessible code location, because field declared in class a(?). question is, there possibility access it?

i found resolution problem. code incorrect:

type c() =     inherit b()      member this.somemethod() =         let d() = base.field.somemagic(someparameter) //this.field fails         d() 

but code works correctly:

type c() =     inherit b()      member this.somemethod() =         let stub = this.field         let d() = stub.somemagic(someparameter)         d() 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -