Giter Club home page Giter Club logo

Comments (3)

jonorossi avatar jonorossi commented on August 16, 2024

Thanks for the details especially those in the SO question.

I've worked out this defect only affects CreateClassProxy and can confirm that it was introduced in 3.2.0 under DYNPROXY-175, which is why 3.1.0 works as you reported.

We don't currently have any unit tests to verify the type parameter which is why this regression unfortunately has occurred.

This is what type is for each generator method:

  • CreateClassProxy: currently a System.RuntimeType because ClassProxyTargetContributor passes through a TypeTokenExpression
  • CreateClassProxyWithTarget: a System.Type for the target
  • CreateInterfaceProxyWithTarget: a System.Type for the target
  • CreateInterfaceProxyWithTargetInterface: a System.Type for the target
  • CreateInterfaceProxyWithoutTarget: null, there is no target

Unfortunately we've also got a mismatch between behaviour and documented behaviour via XML comments. type is implemented as target type, and method is implemented as documented, you can get the type declaring the method to intercept via method.DeclaringType.

public interface IInterceptorSelector
{
    /// <summary>
    ///   Selects the interceptors that should intercept calls to the given <paramref name = "method" />.
    /// </summary>
    /// <param name = "type">The type declaring the method to intercept.</param>
    /// <param name = "method">The method that will be intercepted.</param>
    /// <param name = "interceptors">All interceptors registered with the proxy.</param>
    ...
    IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors);
}

I'll look at getting a set of unit tests added and the fix.

from core.

kkozmic avatar kkozmic commented on August 16, 2024

Has this issue progressed any further?

from core.

jonorossi avatar jonorossi commented on August 16, 2024

No. I think I've got a patch someone in my Windows VM with a hacky fix from January, but never got back to it, the unit tests are probably the only useful bits.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.