Ok I derive a type B
from a base class A
.
A
implements IDisposable
explicit but I have to do additional cleanup in B
, so I implement IDisposable
in B
:
interface IDisposable with
member i.Dispose() =
// ... additional work
base.Dispose() // <- want to do but cannot
Question is: how to access the Dispose-method from base?
(base :> IDisposable).Dispose()
yields compiler error: Unexpected symbol ':>' in expression. Expected '.' or other token.
Doing something like
(i :> IDisposable).Dispose()
of course yields a StackOverflowException
on runtime - so how can I do this? Sorry but never encountered something like this before...
DuplexClientBase
) - so this is not a solution. And yes I know that you cannot use base this way (the compiler says so much) - the question is HOW do I get to the Dispose of base. For now I solved this by using a public member method to clean up and have the callers clean up by calling this method + dispose but this is only a hack and feels just wrong – Gonorrhea