Skip to content

Compilation error: ApiCompat shows Trim analysis error for IEnumerableConverterFactoryHelpers #42902

@vcsjones

Description

@vcsjones

Building master currently is giving me a compilation error.

Steps to reproduce:

  1. Check out master (bisect shows this was introduced in 994dca6)
  2. Run ./build.sh -rc release -s clr+libs

Eventually, the ApiCompat step fails:

/code/personal/dotnet/runtime/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactoryHelpers.cs(179,17): Trim analysis error IL2075: System.Text.Json.Serialization.IEnumerableConverterFactoryHelpers.GetImmutableDictionaryCreateRangeMethod(Type,Type,Type): The requirements declared via the 'DynamicallyAccessedMembersAttribute' on the return value of method 'System.Text.Json.Serialization.IEnumerableConverterFactoryHelpers.GetImmutableDictionaryConstructingType(Type)' don't match those on the implicit 'this' parameter of method 'System.Type.GetMethods()'. The source value must declare at least the same requirements as those declared on the target location it's assigned to [/code/personal/dotnet/runtime/src/libraries/src.proj]

and

code/personal/dotnet/runtime/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactoryHelpers.cs(187,25): Trim analysis error IL2060: System.Text.Json.Serialization.IEnumerableConverterFactoryHelpers.GetImmutableDictionaryCreateRangeMethod(Type,Type,Type): Call to System.Reflection.MethodInfo.MakeGenericMethod(Type[]) can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic method. [/code/personal/dotnet/runtime/src/libraries/src.proj]

Occurs on Ubuntu 20.04.

/cc @layomia

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions