dotnet / dotnet/dotnet-api-docs
Type.GetInterfaceMap with generic interface types
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
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.*
* ID: f037e068-f720-1ece-533e-b71e5de9b393
* Version Independent ID: 9e8ef13d-1ff6-b78e-494a-57227e2225a4
* Content: [Type.GetInterfaceMap(Type) Method (System)](https://docs.microsoft.com/en-us/dotnet/api/system.type.getinterfacemap?view=netcore-2.1#System_Type_GetInterfaceMap_System_Type_)
* Content Source: [xml/System/Type.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System/Type.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**
Contributor guide
Assessment
This issue has not been assessed yet.