CodeQL library for C#

Member predicate Virtualizable::getAnImplementor

Gets a member that immediately implements this interface member, if any.

The type t is a type that implements the interface type in which this member is declared, in such a way that the result is the implementation of this member.


interface I { void M(); }

class A { public void M() { } }

class B : A, I { }

class C : A, I { new public void M() }

In the example above, the following (and nothing else) holds: I.M.getAnImplementor(B) = A.M and I.M.getAnImplementor(C) = C.M.

Virtualizable getAnImplementor(ValueOrRefType t)