Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

Refactors MemberAccess properties from double negatives (IsGetterInaccessible, IsSetterInaccessible) to positive form (IsGetterAccessible, IsSetterAccessible) for improved readability.

Changes

  • PathPart.cs: Renamed properties, flipped defaults to true, updated HasInaccessibleAccessor computation
  • PathParser.cs: Simplified assignment (no longer negating)
  • Setter.cs, AccessExpressionBuilder.cs: Updated pattern matching from IsSetterInaccessible: true to IsSetterAccessible: false
  • BindingCodeWriter.cs: Updated condition checks to use negated positive form
  • Tests: Updated test data in SetterBuilderTests, AccessExpressionBuilderTests, BindingRepresentationGenTests

Before/After

// Before
new MemberAccess("Value", IsGetterInaccessible: true, IsSetterInaccessible: true)
public bool HasInaccessibleAccessor => IsGetterInaccessible || IsSetterInaccessible;

// After  
new MemberAccess("Value", IsGetterAccessible: false, IsSetterAccessible: false)
public bool HasInaccessibleAccessor => !IsGetterAccessible || !IsSetterAccessible;
Original prompt

This section details on the original issue you should resolve

<issue_title>[XSG][Compiled bindings] Refactor code to remove double negatives in MemberAccess</issue_title>
<issue_description>I always get confused because of MemberAccess properties bool IsGetterInaccessible and IsSetterInaccessible. Let's change them to IsGetterAccessible and IsSetterAccessible.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 9, 2026 16:10
Copilot AI changed the title [WIP] Refactor MemberAccess properties to use positive terms [XSG] Refactor MemberAccess to remove double negatives Jan 9, 2026
Copilot AI requested a review from simonrozsival January 9, 2026 16:17
@simonrozsival simonrozsival marked this pull request as ready for review January 9, 2026 17:15
Copilot AI review requested due to automatic review settings January 9, 2026 17:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the MemberAccess record properties from double negatives (IsGetterInaccessible, IsSetterInaccessible) to positive form (IsGetterAccessible, IsSetterAccessible) to improve code readability throughout the BindingSourceGen code generator.

Key Changes:

  • Property defaults changed from false to true (members are accessible by default)
  • Logic inversions applied where properties are checked
  • Pattern matching expressions updated to check for false instead of true

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
PathPart.cs Renamed properties to positive form, updated defaults to true, inverted logic in HasInaccessibleAccessor computation
PathParser.cs Simplified assignment by removing double negation when setting property values
Setter.cs Updated pattern matching from IsSetterInaccessible: true to IsSetterAccessible: false
AccessExpressionBuilder.cs Updated pattern matching from IsGetterInaccessible: true to IsGetterAccessible: false
BindingCodeWriter.cs Updated condition checks to negate positive properties (!member.IsGetterAccessible)
SetterBuilderTests.cs Updated test data to use new property names with appropriate boolean values
BindingRepresentationGenTests.cs Updated test expectations to use new property names
AccessExpressionBuilderTests.cs Updated test data to use new property names

@simonrozsival
Copy link
Member

/azp run maui-pr-devicetests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants