Linker doesn't trim IEnumerable interface in console app even if it's not used
- Dominant language
- C#
- Stars
- 392
- Forks
- 128
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 2
Description
```csharp
internal class Program
{
static void Main(string[] args)
{
var t = new CustomClass();
}
private sealed class CustomClass : IEnumerable
{
public IEnumerator GetEnumerator()
{
return new CustomEnumerator();
}
}
private sealed class CustomEnumerator : IEnumerator
{
public object Current => throw new NotImplementedException();
public bool MoveNext()
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
}
}
```

Npgsql implements that interface for `NpgsqlDataReader` (because `NpgsqlDataReader` inherits from `DbDataReader`, inheriting `IEnumerable`). Our implementation of `GetEnumerator` returns `System.Data.Common.DbEnumerator`, which touches quite a bit of `IDataReader` methods, and some of them are not AOT friendly (mostly related to size).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.