Skip to content

Annotate FSharp.Core for trimmability #15980

Closed
@charlesroddie

Description

@charlesroddie

Compile an F# app with NativeAOT

Set <TrimmerSingleWarn>false</TrimmerSingleWarn> to see detailed logs.

Many warnings result. These are mostly from FSharp.Core but some are from a "Compiler" namespace and presumably leak from there into FSharp.Core.

F# should be annotated for trimming so that users who do not use problematic constructs will not get warnings. Problematic code should be annotated with DynamicallyAccessedMemberTypes etc.. The aim of the trimming annotations is to give users full confidence that, if there are no warnings, then AOT compilation will work.

The code warned about should not be actually called if users are careful, and if they set --reflectionfree they will be given help in avoiding problematic code (like sprintf used explicitly), and the compiler will also not generate problematic code (like sprintf generated from DUs).

However --reflectionfree doesn't catch all uses of reflection (although it could and should be extended to do that), so there are currently false negatives, and there are also a lot of false positives as seen below. So this is complementary to the standard dotnet trimming annotation approach.

FSharp.Core\seq.fs(333): Trim analysis warning IL2091: Microsoft.FSharp.Collections.Internal.IEnumerator.upto<TResult>(FSharpOption`1<Int32>,FSharpFunc`2<Int32,!!0>): 'T' generic argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in 'System.Lazy`1'. The generic parameter 'TResult' of 'Microsoft.FSharp.Collections.Internal.IEnumerator.upto<TResult>(FSharpOption`1<Int32>,FSharpFunc`2<Int32,!!0>)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\printf.fs(1283): AOT analysis warning IL3050: Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.parseAndCreateFunctionFactory(): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.
FSharp.Core\printf.fs(1291): AOT analysis warning IL3050: Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.parseAndCreateFunctionFactory(): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.
FSharp.Core\printf.fs(1107): AOT analysis warning IL3050: Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.buildCaptureFunc<a>(PrintfImpl.FormatSpecifier,a,Type[],Type,Tuple`5<Object,Boolean,Type[],Type,FSharpOption`1<Object>>): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.
FSharp.Core\printf.fs(1119): Trim analysis warning IL2060: Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.buildCaptureFunc<a>(PrintfImpl.FormatSpecifier,a,Type[],Type,Tuple`5<Object,Boolean,Type[],Type,FSharpOption`1<Object>>): 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.
FSharp.Core\printf.fs(1119): AOT analysis warning IL3050: Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.buildCaptureFunc<a>(PrintfImpl.FormatSpecifier,a,Type[],Type,Tuple`5<Object,Boolean,Type[],Type,FSharpOption`1<Object>>): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.
FSharp.Core\printf.fs(1125): Trim analysis warning IL2060: Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.buildCaptureFunc<a>(PrintfImpl.FormatSpecifier,a,Type[],Type,Tuple`5<Object,Boolean,Type[],Type,FSharpOption`1<Object>>): 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.
FSharp.Core\printf.fs(1125): AOT analysis warning IL3050: Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.buildCaptureFunc<a>(PrintfImpl.FormatSpecifier,a,Type[],Type,Tuple`5<Object,Boolean,Type[],Type,FSharpOption`1<Object>>): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.
FSharp.Core\printf.fs(1132): Trim analysis warning IL2060: Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.buildCaptureFunc<a>(PrintfImpl.FormatSpecifier,a,Type[],Type,Tuple`5<Object,Boolean,Type[],Type,FSharpOption`1<Object>>): 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.
FSharp.Core\printf.fs(1132): AOT analysis warning IL3050: Microsoft.FSharp.Core.PrintfImpl.FormatParser`4.buildCaptureFunc<a>(PrintfImpl.FormatSpecifier,a,Type[],Type,Tuple`5<Object,Boolean,Type[],Type,FSharpOption`1<Object>>): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.
FSharp.Core\printf.fs(1005): Trim analysis warning IL2060: Microsoft.FSharp.Core.PrintfImpl.getValueConverter(Type,PrintfImpl.FormatSpecifier): 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.
FSharp.Core\printf.fs(1005): AOT analysis warning IL3050: Microsoft.FSharp.Core.PrintfImpl.getValueConverter(Type,PrintfImpl.FormatSpecifier): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.
FSharp.Core\printf.fs(1163): Trim analysis warning IL2060: Microsoft.FSharp.Core.PrintfImpl.convFunc@1163-1.Invoke(a,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.
FSharp.Core\printf.fs(1163): AOT analysis warning IL3050: Microsoft.FSharp.Core.PrintfImpl.convFunc@1163-1.Invoke(a,Type): Using member 'System.Reflection.MethodInfo.MakeGenericMethod(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.
Compiler\Utilities\sformat.fs(571): Trim analysis warning IL2067: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfo<a>(BindingFlags,a,Type): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.GetUnionCases(Type,FSharpOption`1<BindingFlags>)'. The parameter '#2' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfo<a>(BindingFlags,a,Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(1356): Trim analysis warning IL2075: Microsoft.FSharp.Text.StructuredPrintfImpl.Display.ObjectGraphFormatter.sequenceValueL(Display.ShowMode,Int32,Display.Precedence,IEnumerable): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(1365): Trim analysis warning IL2075: Microsoft.FSharp.Text.StructuredPrintfImpl.Display.ObjectGraphFormatter.sequenceValueL(Display.ShowMode,Int32,Display.Precedence,IEnumerable): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(589): Trim analysis warning IL2070: Microsoft.FSharp.Text.StructuredPrintfImpl.Display.typeUsesSystemObjectToString(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods' in call to 'System.Type.GetMethod(String,BindingFlags,Binder,Type[],ParameterModifier[])'. The parameter '#0' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.Display.typeUsesSystemObjectToString(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(1408): Trim analysis warning IL2070: Microsoft.FSharp.Text.StructuredPrintfImpl.Display.ObjectGraphFormatter.objectValueWithPropertiesL(Int32,Type,Object): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter '#1' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.Display.ObjectGraphFormatter.objectValueWithPropertiesL(Int32,Type,Object)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(1412): Trim analysis warning IL2070: Microsoft.FSharp.Text.StructuredPrintfImpl.Display.ObjectGraphFormatter.objectValueWithPropertiesL(Int32,Type,Object): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields' in call to 'System.Type.GetFields(BindingFlags)'. The parameter '#1' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.Display.ObjectGraphFormatter.objectValueWithPropertiesL(Int32,Type,Object)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(1448): Trim analysis warning IL2070: Microsoft.FSharp.Text.StructuredPrintfImpl.Display.ObjectGraphFormatter.objectValueWithPropertiesL(Int32,Type,Object): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'System.Type.InvokeMember(String,BindingFlags,Binder,Object,Object[],CultureInfo)'. The parameter '#1' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.Display.ObjectGraphFormatter.objectValueWithPropertiesL(Int32,Type,Object)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(470): Trim analysis warning IL2067: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.isListType(Type): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.IsUnion(Type,FSharpOption`1<BindingFlags>)'. The parameter '#0' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.isListType(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(471): Trim analysis warning IL2067: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.isListType(Type): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.GetUnionCases(Type,FSharpOption`1<BindingFlags>)'. The parameter '#0' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.isListType(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(504): Trim analysis warning IL2072: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject(BindingFlags,Object): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.IsTuple(Type)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(505): Trim analysis warning IL2072: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject(BindingFlags,Object): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.GetTupleElements(Type)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(518): Trim analysis warning IL2072: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject(BindingFlags,Object): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.IsFunction(Type)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(526): Trim analysis warning IL2067: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.IsUnion(Type,FSharpOption`1<BindingFlags>)'. The parameter '#2' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(527): Trim analysis warning IL2067: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpValue.GetUnionFields(Object,Type,FSharpOption`1<BindingFlags>)'. The parameter '#2' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(535): Trim analysis warning IL2067: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.IsExceptionRepresentation(Type,FSharpOption`1<BindingFlags>)'. The parameter '#2' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(536): Trim analysis warning IL2067: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.GetExceptionFields(Type,FSharpOption`1<BindingFlags>)'. The parameter '#2' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(544): Trim analysis warning IL2067: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.IsRecord(Type,FSharpOption`1<BindingFlags>)'. The parameter '#2' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(545): Trim analysis warning IL2067: Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit): '' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'Microsoft.FSharp.Reflection.FSharpType.GetRecordFields(Type,FSharpOption`1<BindingFlags>)'. The parameter '#2' of method 'Microsoft.FSharp.Text.StructuredPrintfImpl.ReflectUtils.Value.GetValueInfoOfObject$cont@526(BindingFlags,Object,Type,Unit)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(389): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.getUnionTypeTagNameMap(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.NonPublicNestedTypes' in call to 'System.Type.GetNestedType(String,BindingFlags)'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.getUnionTypeTagNameMap(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(393): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.getUnionTypeTagNameMap(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethods(BindingFlags)'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.getUnionTypeTagNameMap(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(416): Trim analysis warning IL2075: Microsoft.FSharp.Reflection.Impl.getUnionTypeTagNameMap(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.NonPublicFields' in call to 'System.Type.GetFields(BindingFlags)'. The return value of method 'System.Type.GetNestedType(String,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(1082): Trim analysis warning IL2080: Microsoft.FSharp.Text.StructuredPrintfImpl.Display.buildObjMessageL@1082-2.Invoke(Unit): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.All' in call to 'System.Type.InvokeMember(String,BindingFlags,Binder,Object,Object[],CultureInfo)'. The field 'Microsoft.FSharp.Text.StructuredPrintfImpl.Display.buildObjMessageL@1082-2.ty' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(1327): Trim analysis warning IL2075: Microsoft.FSharp.Text.StructuredPrintfImpl.Display.possibleKeyValueL@1317-1.Invoke(!0): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
Compiler\Utilities\sformat.fs(1327): Trim analysis warning IL2075: Microsoft.FSharp.Text.StructuredPrintfImpl.Display.possibleKeyValueL@1317-1.Invoke(!0): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(853): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.getTupleElementAccessors(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicFields' in call to 'System.Type.GetFields(BindingFlags)'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.getTupleElementAccessors(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(855): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.getTupleElementAccessors(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.getTupleElementAccessors(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(972): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.fieldPropsOfRecordType(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.fieldPropsOfRecordType(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(558): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.getUnionTagReader(Type,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String,BindingFlags,Binder,Type[],ParameterModifier[])'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.getUnionTagReader(Type,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(525): Trim analysis warning IL2075: Microsoft.FSharp.Reflection.Impl.fieldsPropsOfUnionCase(Type,Int32,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The return value of method 'Microsoft.FSharp.Reflection.Impl.getUnionCaseTyp(Type,Int32,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(525): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.fieldsPropsOfUnionCase(Type,Int32,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperties(BindingFlags)'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.fieldsPropsOfUnionCase(Type,Int32,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(73): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.getInstancePropertyInfos(Type,String[],BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperty(String,BindingFlags)'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.getInstancePropertyInfos(Type,String[],BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(445): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.getUnionCaseTyp(Type,Int32,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.NonPublicNestedTypes' in call to 'System.Type.GetNestedType(String,BindingFlags)'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.getUnionCaseTyp(Type,Int32,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
FSharp.Core\reflect.fs(449): Trim analysis warning IL2055: Microsoft.FSharp.Reflection.Impl.getUnionCaseTyp(Type,Int32,BindingFlags): Call to 'System.Type.MakeGenericType(Type[])' can not be statically analyzed. It's not possible to guarantee the availability of requirements of the generic type.
FSharp.Core\reflect.fs(449): AOT analysis warning IL3050: Microsoft.FSharp.Reflection.Impl.getUnionCaseTyp(Type,Int32,BindingFlags): Using member 'System.Type.MakeGenericType(Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.
FSharp.Core\reflect.fs(76): Trim analysis warning IL2070: Microsoft.FSharp.Reflection.Impl.getInstancePropertyReader(Type,String,BindingFlags): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.NonPublicProperties' in call to 'System.Type.GetProperty(String,BindingFlags)'. The parameter '#0' of method 'Microsoft.FSharp.Reflection.Impl.getInstancePropertyReader(Type,String,BindingFlags)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions