See dotnet/runtime#61737
In this case the compiler emits references to the modreq [System.Text.Json]System.Runtime.CompilerServices.IsExternalInit
. This type is defined as internal in System.Text.Json
. If this appears in a public method, then we need to treat the modreq-target-type as effectively public, even if it is internal.
Treating it as public will ensure it is defined or forwarded in compatible assemblies.