Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent member name collision when proxy implements same generic interface more than twice #285

Merged

Commits on Jul 4, 2017

  1. Explicit interface implementation name collisions

    When a proxy is made to implement the same generic interface more than
    twice, and that generic interface contains a method that does not use
    any generic type parameters, this can be result in a name collision.
    This would happen e.g. with a proxy implementing `IObserver<T>` three
    times.
    
    DynamicProxy does check for member name collisions, and when such a
    one is detected, it switches to explicit interface implementation and
    prefixes the member name with the generic interface type name. For the
    above example, this will add the following methods to the proxy:
    
     * OnCompleted
     * IObserver`1.OnCompleted
     * IObserver`1.OnCompleted
    
    It is clearly not sufficient to exclude the concrete type arguments
    and use only the number of type parameters. This commit changes the
    naming of explicitly implemented interface methods such that they are
    unique by including the generic type arguments. For example:
    
     * OnCompleted
     * IObserver`1[Boolean].OnCompleted
     * IObserver`1[Int32].OnCompleted
    stakx committed Jul 4, 2017
    Configuration menu
    Copy the full SHA
    55192ae View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2017

  1. Configuration menu
    Copy the full SHA
    dd4f853 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d5c941f View commit details
    Browse the repository at this point in the history