From dbbc0ac103a133634eb3ce78cf04e72bd23e32ea Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Fri, 24 Apr 2026 16:00:41 -0500 Subject: [PATCH] [xabt] Fix redundant ternary in GenerateResourceDesignerAssembly Both branches of the ternary on line 155 produced TypeAttributes.Public, making the conditional dead code. Simplify to a direct assignment. The IVT at lines 108-114 suggests one branch may have been intended to use NotPublic, but since the type has been public since inception (PR #6427), changing visibility would be a behavioral change best handled separately. The IVT attribute remains harmless when the type is already public. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Tasks/GenerateResourceDesignerAssembly.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateResourceDesignerAssembly.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateResourceDesignerAssembly.cs index 87da4c2995c..9b1983bdf76 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateResourceDesignerAssembly.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateResourceDesignerAssembly.cs @@ -152,7 +152,7 @@ bool Run (DirectoryAssemblyResolver res) TypeDefinition? constDesigner = null; if (IsApplication) { // The Constant based class - TypeAttributes attrib = AssemblyName.IsNullOrEmpty () ? TypeAttributes.Public : TypeAttributes.Public; + TypeAttributes attrib = TypeAttributes.Public; constDesigner = new TypeDefinition ( FixLegacyResourceDesignerStep.DesignerAssemblyNamespace, "ResourceConstant",