-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[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 4 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 |
|---|---|---|
|
|
@@ -523,10 +523,10 @@ private sealed class LicenseClassFactory : IClassFactory2 | |
| private readonly LicenseInteropProxy _licenseProxy = new LicenseInteropProxy(); | ||
| private readonly Guid _classId; | ||
|
|
||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] | ||
| [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces | DynamicallyAccessedMemberTypes.PublicConstructors)] | ||
| private readonly Type _classType; | ||
|
|
||
| public LicenseClassFactory(Guid clsid, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type classType) | ||
| public LicenseClassFactory(Guid clsid, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces | DynamicallyAccessedMemberTypes.PublicConstructors)] Type classType) | ||
| { | ||
| _classId = clsid; | ||
| _classType = classType; | ||
|
|
@@ -627,6 +627,9 @@ internal sealed class LicenseInteropProxy | |
| private object? _licContext; | ||
| private Type? _targetRcwType; | ||
|
|
||
| [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2111", | ||
| Justification = "The type parameter to LicenseManager.CreateWithContext method has PublicConstructors annotation. We only invoke this method" + | ||
| "from AllocateAndValidateLicense which annotates the value passed in with the same annotation.")] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yay for extra validation. Caught a bug here... |
||
| public LicenseInteropProxy() | ||
| { | ||
| Type licManager = Type.GetType("System.ComponentModel.LicenseManager, System.ComponentModel.TypeConverter", throwOnError: true)!; | ||
|
|
@@ -742,7 +745,7 @@ public string RequestLicKey(Type type) | |
| // If we are being entered because of a call to ICF::CreateInstanceLic(), | ||
| // "isDesignTime" will be "false" and "key" will point to a non-null | ||
| // license key. | ||
| public object AllocateAndValidateLicense(Type type, string? key, bool isDesignTime) | ||
| public object AllocateAndValidateLicense([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type type, string? key, bool isDesignTime) | ||
| { | ||
| object?[] parameters; | ||
| object? licContext; | ||
|
|
||
| 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", | ||||||||||||||||
| 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))] | ||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the trimmer treat I'm wondering if this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, it does. Good question about DynamicDependency. I only found one place where the annotation was ultimately used: runtime/src/libraries/System.Data.Common/src/System/Data/Common/SqlUDTStorage.cs Lines 45 to 51 in f9cbd72
If I didn't miss anything I think it's ok to remove. |
||||||||||||||||
| static DataColumn GetSystemTypeDataColumn() => | ||||||||||||||||
| new DataColumn(SchemaTableColumn.DataType, typeof(Type)); | ||||||||||||||||
|
|
||||||||||||||||
| DataColumn ProviderType = new DataColumn(SchemaTableColumn.ProviderType, typeof(int)); | ||||||||||||||||
| DataColumn IsLong = new DataColumn(SchemaTableColumn.IsLong, typeof(bool)); | ||||||||||||||||
| DataColumn AllowDBNull = new DataColumn(SchemaTableColumn.AllowDBNull, typeof(bool)); | ||||||||||||||||
|
|
||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.