[xabt] Fix redundant ternary in GenerateResourceDesignerAssembly#11214
Open
jonathanpeppers wants to merge 1 commit intomainfrom
Open
[xabt] Fix redundant ternary in GenerateResourceDesignerAssembly#11214jonathanpeppers wants to merge 1 commit intomainfrom
jonathanpeppers wants to merge 1 commit intomainfrom
Conversation
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>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a dead/ redundant conditional in GenerateResourceDesignerAssembly while preserving existing behavior for the generated ResourceConstant type inside the resource designer assembly generation task.
Changes:
- Replace a ternary expression that always evaluated to
TypeAttributes.Publicwith a direct assignment toTypeAttributes.Public.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Simplify a dead conditional in
GenerateResourceDesignerAssembly.cswhere both ternary branches produced the same value (TypeAttributes.Public).Changes
Before:
After:
Context
This dead conditional was introduced in the original commit (
dc3ccf28c, PR #6427). The IVT attribute added at lines 108-114 suggests one branch may have been intended to useTypeAttributes.NotPublic, but since theResourceConstanttype has been public since inception, changing visibility would be a behavioral change. The IVT attribute is harmless when the type is already public, so this PR simply removes the redundant ternary without altering behavior.This is a zero-semantic-difference simplification — no behavioral change.