Emit specialized native method for methods in a closed subclass over a generic type
- Dominant language
- C#
- Stars
- 2.9k
- Forks
- 576
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
### Steps to Reproduce
This is used as a node for an NSOutlineView, but it's possible to reproduce by just calling the `hash` selector.
```csharp
class RecursiveType where T:RecursiveType
{
public T MyValue;
public override nuint GetNativeHash()
{
return MyValue.GetHashCode();
}
}
sealed class ClosedView : RecursiveType
{
}
```
### Expected Behavior
The callpaths should be quick for the `sealed ClosedView`. The type has all the information needed to resolve without doing runtime checks.
### Actual Behavior
The methods are resolved at runtime via generic APIs.
See https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1533115/ and https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1532127
### Environment
VSMac, dotnet6 xamarin-macios, 6.0.201.
cc @rolfbjarne Does this need more information?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.