コード例 #1
0
    public void Callsite(InterfaceB intF)
    {
        B b = new B();

        // in both possible implementations of foo, this callsite is relevant
        // in IntA, it improves virtual dispatch,
        // and in IntB, it improves the dataflow analysis.
        intF.Foo(b, new object(), false);
    }
コード例 #2
0
    public void Callsite(InterfaceB intF)
    {
        B b = new B();

        // in both possible implementations of foo, this callsite is relevant
        // in IntA, it improves virtual dispatch,
        // and in IntB, it improves the dataflow analysis.
        intF.Foo(b, new object(), false); // no flow to `Sink()` via `A2.M()`, but flow via `IntA.Foo()`

        CallM(b, new object());           // no flow to `Sink()`
        CallM(this, new object());        // flow to `Sink()`
    }