Skip to content

Commit 8839704

Browse files
authored
Update suppression reason for Assembly.GetType call (#105577)
With #104060 there will be trim warnings whenever a non-qualified type name is used with this API, so the call to `_type.AssemblyGetType` is effectively unreachable in a trimmed app with no trim warnings and it is safe to suppress.
1 parent 040fde4 commit 8839704

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.ReflectedTypeData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ internal PropertyDescriptorCollection GetProperties()
509509
/// then a global Type.GetType is performed.
510510
/// </summary>
511511
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
512-
Justification = "Calling _type.Assembly.GetType on a non-assembly qualified type will still work. See https://github.com/mono/linker/issues/1895")]
512+
Justification = "Trimming requires fully-qualified type names for strings annotated with DynamicallyAccessedMembers, so the call to _type.Assembly.GetType should be unreachable in an app without trim warnings.")]
513513
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2057:TypeGetType",
514514
Justification = "Using the non-assembly qualified type name will still work.")]
515515
private Type? GetTypeFromName(

0 commit comments

Comments
 (0)