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
Post a Comment