Skip to content

Type.GetInterfaceMap with generic interface types #819

Open
@pavel-agarkov

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions