Skip to content

Proposal: Address noisy IDisposable vtable warning #1968

@manodasanW

Description

@manodasanW

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions