Proposal: Address noisy IDisposable vtable warning
Summary
When CsWinRTAotWarningLevel is set to 2, warnings are enabled for classes not marked partial that implement custom mapped interfaces given we can't generate vtables for them. Out of all the custom mapped interfaces, IDisposable seems to be a bit noisy as there are classes implementing it but not passed across the WinRT ABI compared to the other ones. We should find a way to address this.
Rationale
To allow consumers to be able to set CsWinRTAotWarningLevel to 2 by default and not be impacted by the noise.
Important Notes
There are a couple approaches:
- If the class just implements IDisposable, maybe we should just ignore it for the warning if not partial. We will still generate the vtable if marked partial.
- Have a property to suppress just IDisposable related warnings.
- Have a ItemGroup that custom mapped interfaces can be added to and that indicates if a type just implements one of those interfaces, the warning should be suppressed and vtable should be generated if just that interface.
Open Questions
No response
Aside from the trouble to make each class that implements IDisposable partial (such as Stream subclasses), is there any downside to generate the vtables? Is the assembly size and/or performance affected?
There's a non-insignificant regression in binary size.