You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
InterfaceMap when mapping static abstract generic methods does not return a generic method definition. The generic arguments are also generic method type parameters, but they are the ones for the interface type.
Reproduction Steps
publicinterfaceI<T>whereT:I<T>{publicvoidInstance<M>(Mm);publicstaticabstractvoidStatic<M>(Mm);}publicreadonlystructC:I<C>{publicvoidInstance<M>(Mm){}publicstaticvoidStatic<M>(Mm){}}internalclassProgram{staticvoidMain(string[]args){varinterfaceMap=typeof(C).GetInterfaceMap(typeof(I<C>));for(inti=0;i<interfaceMap.InterfaceMethods.Length;i++){varimethod=interfaceMap.InterfaceMethods[i];vartmethod=interfaceMap.TargetMethods[i];Console.WriteLine($"Interface.{imethod.Name} is generic method def: {imethod.IsGenericMethodDefinition}");Console.WriteLine($"Target.{tmethod.Name} is generic method def: {tmethod.IsGenericMethodDefinition}");}Console.Read();}}
Expected behavior
Interface.Instance is generic method def: True
Target.Instance is generic method def: True
Interface.Static is generic method def: True
Target.Static is generic method def: True
Actual behavior
Interface.Instance is generic method def: True
Target.Instance is generic method def: True
Interface.Static is generic method def: True
Target.Static is generic method def: False
Regression?
No as these are new.
Known Workarounds
No response
Configuration
.net 7 preview 7.
Other information
No response
The text was updated successfully, but these errors were encountered:
I have verified locally that the problem described in the issue
no longer exists in .NET 8 RC1, the bug was probably fixed earlier
this year by David Wrighton. I think the regression test described
in the issue is useful so I'm proposing to merge it in; this PR
will then close the issue.
Fixes: dotnet#74132
Thanks
Tomas
ghost
added
in-pr
There is an active PR which will close this issue when it is merged
and removed
in-pr
There is an active PR which will close this issue when it is merged
labels
Aug 23, 2023
Description
InterfaceMap when mapping static abstract generic methods does not return a generic method definition. The generic arguments are also generic method type parameters, but they are the ones for the interface type.
Reproduction Steps
Expected behavior
Actual behavior
Regression?
No as these are new.
Known Workarounds
No response
Configuration
.net 7 preview 7.
Other information
No response
The text was updated successfully, but these errors were encountered: