-
Notifications
You must be signed in to change notification settings - Fork 377
Closed
Labels
area-Infrastructure-librariesArea maintained by .NET libraries team: APICompat, AsmDiff, GenAPI, GenFacades, PkgProj, etcArea maintained by .NET libraries team: APICompat, AsmDiff, GenAPI, GenFacades, PkgProj, etc
Description
I am modifying System.Text.Json to expose public APIs using the in modifier to support feature https://github.com/dotnet/corefx/issues/34372
APICompat is failing with several errors like this:
error : ParameterModifiersCannotChange : Custom modifiers on parameter 'reader' on method 'System.Text.Json.Serialization.JsonTypeSerializer<TType>.OnDeserialized(TType, System.Text.Json.Serialization.JsonClassInfo<TType>, System.Text.Json.Utf8JsonReader, System.Text.Json.Serialization.JsonSerializerOptions, System.Collections.Generic.IDictionary<System.String, System.Object>)' are 'System.Runtime.InteropServices.InAttribute' in the implementation but 'System.Runtime.InteropServices.InAttribute' in the contract. [D:\git\corefx2\src\System.Text.Json\src\System.Text.Json.csproj]
From looking at the IL, the ref's in modifier attribute looks like this:
[System.Runtime]System.Runtime.InteropServices.InAttribute
while the implementation IL looks likes this:
[System.Private.CoreLib]System.Runtime.InteropServices.InAttribute
Which is causing ApiCompat to fail here
Metadata
Metadata
Assignees
Labels
area-Infrastructure-librariesArea maintained by .NET libraries team: APICompat, AsmDiff, GenAPI, GenFacades, PkgProj, etcArea maintained by .NET libraries team: APICompat, AsmDiff, GenAPI, GenFacades, PkgProj, etc