Fix a number of accessibility resolution issues in the source generator.#87136
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsUpdates the source generator to use the built-in Roslyn
|
| { | ||
| classType = ClassType.Enum; | ||
| } | ||
| else if (type.GetCompatibleGenericBaseType(_knownSymbols.IAsyncEnumerableOfTType) is INamedTypeSymbol iasyncEnumerableType) |
There was a problem hiding this comment.
The deleted code has been extracted into the TryResolveCollectionType method .
| CheckCompilationDiagnosticsErrors(result.NewCompilation.GetDiagnostics()); | ||
|
|
||
| Assert.Equal(4, result.AllGeneratedTypes.Count()); | ||
| Assert.Equal(3, result.AllGeneratedTypes.Count()); |
There was a problem hiding this comment.
Generated type number changed because we no longer include the compiler-generated EqualityContract property.
|
cc @Sergio0694 it would be interesting to see how this impacts your application size. |
|
@eiriktsarpalis will share binary size deltas in the Store and in the NAOT sample with the new package from this PR! 👍 |
|
@eiriktsarpalis size diffs for the Microsoft Store below:
Deltas:
Pretty nice win overall, and it seems this PR saved another ~35 KB per arch. Not groundbreaking, but hey, it's free 😄 |
Updates the source generator to use the built-in Roslyn
IsSymbolAccessibleWithinmethod when resolving accessibility for symbols. This addresses the following issues: