CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Ensure WinRT.Runtime stability with embedded constant

Open j0shuams opened this issue 3 years ago • 0 comments

We had an issue where a couple of new types in WinRT.Runtime didn't get the #if EMBED treatment needed. We should add an analyzer (or better a codefix) to WinRT.Runtime to prevent this in the future.

E.g.

namespace SomeWinRTRuntimeTypeFamily
{
  public IEnumerable<Foo> NewType = ...;
}

becomes (with codefix or after being warned by an analyzer)

namespace SomeWinRTRuntimeTypeFamily
{
#if EMBED
  internal
#else
  public 
#endif
  IEnumerable<Foo> NewType = ...;
}

j0shuams avatar Mar 15 '22 01:03 j0shuams