Skip to content

Type.GetInterfaceMap with generic interface types #819

Description

@pavel-agarkov

When type parameter of Type.GetInterfaceMap method is represented by:

  1. Open generic constructed type - method throws ArgumentException "interface not found" which is not mentioned in the docs
  2. Closed generic constructed type - method returns InterfaceMapping with InterfaceType property equal to the specified type parameter, but not the actual version of implemented generic interface. Generic parameters in the returned type correspond to the specified type parameter, but not to the actual implemented interface type. So the following remark from the docs is incorrect:

If the current Type represents a constructed generic type, type parameters are replaced by the appropriate type arguments in the elements of the InterfaceMapping returned by this method.

dotnet core 2.1


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions