-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[main] Update dependencies from mono/linker #56593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
4f9af86
890bcb7
43f29d7
4afe081
06b421b
a53d3d6
c353468
1a111df
03dc002
b96ed81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,8 @@ | |
|
|
||
| namespace System.Data.Common | ||
| { | ||
| // This coarse suppression silences all RequiresUnreferencedCode warnings in the class. | ||
| // https://github.com/mono/linker/issues/2136 tracks making it possible to add more granular suppressions at the member level, and with a different warning code. | ||
| [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", | ||
| Justification = "The use of GetType preserves members with RequiresUnreferencedCode, but the GetType callsites either " | ||
| [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2113:RequiresUnreferencedCode", | ||
|
||
| Justification = "The use of GetType preserves ICustomTypeDescriptor members with RequiresUnreferencedCode, but the GetType callsites either " | ||
| + "occur in RequiresUnreferencedCode scopes, or have individually justified suppressions.")] | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] | ||
| public class DbConnectionStringBuilder : IDictionary, ICustomTypeDescriptor | ||
|
|
@@ -393,6 +391,9 @@ internal Attribute[] GetAttributesFromCollection(AttributeCollection collection) | |
| return attributes; | ||
| } | ||
|
|
||
| [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:RequiresUnreferencedCode", | ||
| Justification = "The use of GetType preserves this member with RequiresUnreferencedCode, but the GetType callsites either " | ||
| + "occur in RequiresUnreferencedCode scopes, or have individually justified suppressions.")] | ||
| [RequiresUnreferencedCode("PropertyDescriptor's PropertyType cannot be statically discovered.")] | ||
| private PropertyDescriptorCollection GetProperties() | ||
| { | ||
|
|
@@ -419,6 +420,9 @@ private PropertyDescriptorCollection GetProperties() | |
| return propertyDescriptors; | ||
| } | ||
|
|
||
| [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:RequiresUnreferencedCode", | ||
| Justification = "The use of GetType preserves this member with RequiresUnreferencedCode, but the GetType callsites either " | ||
| + "occur in RequiresUnreferencedCode scopes, or have individually justified suppressions.")] | ||
| [RequiresUnreferencedCode("PropertyDescriptor's PropertyType cannot be statically discovered.")] | ||
| protected virtual void GetProperties(Hashtable propertyDescriptors) | ||
| { | ||
|
|
@@ -526,6 +530,9 @@ protected virtual void GetProperties(Hashtable propertyDescriptors) | |
| } | ||
| } | ||
|
|
||
| [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2112:RequiresUnreferencedCode", | ||
| Justification = "The use of GetType preserves this member with RequiresUnreferencedCode, but the GetType callsites either " | ||
| + "occur in RequiresUnreferencedCode scopes, or have individually justified suppressions.")] | ||
| [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")] | ||
| private PropertyDescriptorCollection GetProperties(Attribute[]? attributes) | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -737,7 +737,16 @@ internal static DataTable GetSchemaTableFromDataTable(DataTable table) | |||||||||||||||
| DataColumn ColumnSize = new DataColumn(SchemaTableColumn.ColumnSize, typeof(int)); | ||||||||||||||||
| DataColumn NumericPrecision = new DataColumn(SchemaTableColumn.NumericPrecision, typeof(short)); | ||||||||||||||||
| DataColumn NumericScale = new DataColumn(SchemaTableColumn.NumericScale, typeof(short)); | ||||||||||||||||
| DataColumn DataType = new DataColumn(SchemaTableColumn.DataType, typeof(Type)); | ||||||||||||||||
| DataColumn DataType = GetSystemTypeDataColumn(); | ||||||||||||||||
|
|
||||||||||||||||
| [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2111:RequiresDynamicallyAccessedMembers", | ||||||||||||||||
| Justification = "The problem is Type.TypeInitializer which requires constructors on the Type instance." + | ||||||||||||||||
| "In this case the Type instance is about System.Type itself, so adding an explicit dependency on the same" + | ||||||||||||||||
| "annotation here.")] | ||||||||||||||||
| [DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors, typeof(Type))] | ||||||||||||||||
|
||||||||||||||||
| PropertyInfo? propInfo = type.GetProperty("Null", BindingFlags.Public | BindingFlags.Static); | |
| if (propInfo != null) | |
| { | |
| return propInfo.GetValue(null, null)!; | |
| } | |
| FieldInfo fieldInfo = type.GetField("Null", BindingFlags.Public | BindingFlags.Static)!; |
If I didn't miss anything I think it's ok to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay for extra validation. Caught a bug here...