Skip to content

Commit

Permalink
Update suppression reason for Assembly.GetType call (#105577)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sbomer authored Jul 29, 2024
1 parent 040fde4 commit 8839704
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ internal PropertyDescriptorCollection GetProperties()
/// then a global Type.GetType is performed.
/// </summary>
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Justification = "Calling _type.Assembly.GetType on a non-assembly qualified type will still work. See https://github.com/mono/linker/issues/1895")]
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.")]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2057:TypeGetType",
Justification = "Using the non-assembly qualified type name will still work.")]
private Type? GetTypeFromName(
Expand Down

0 comments on commit 8839704

Please sign in to comment.