Skip to content

[XSG] Refactor MemberAccess to remove double negatives#33449

Merged
PureWeen merged 7 commits intonet11.0from
copilot/refactor-member-access-properties
Jan 19, 2026
Merged

[XSG] Refactor MemberAccess to remove double negatives#33449
PureWeen merged 7 commits intonet11.0from
copilot/refactor-member-access-properties

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

  • Refactor IsGetterInaccessible to IsGetterAccessible in MemberAccess record (PathPart.cs)
  • Refactor IsSetterInaccessible to IsSetterAccessible in MemberAccess record (PathPart.cs)
  • Update the computed property HasInaccessibleAccessor to use the new properties
  • Update PathParser.cs to use the new property names (simplified assignment)
  • Update Setter.cs to check for IsSetterAccessible: false instead of IsSetterInaccessible: true
  • Update AccessExpressionBuilder.cs to check for IsGetterAccessible: false instead of IsGetterInaccessible: true
  • Update BindingCodeWriter.cs to use the new property names
  • Update all test files to use the new property names:
    • SetterBuilderTests.cs
    • BindingRepresentationGenTests.cs
    • AccessExpressionBuilderTests.cs
  • Build and verify tests pass (all 119 tests pass)
  • Run code review (passed with no comments)
  • Run CodeQL security scan (no issues found)
  • Fix CI failure by adding missing RelayCommand support code from base branch (updated to use new property names)
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
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
…ssible to IsGetterAccessible/IsSetterAccessible

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
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).

@simonrozsival
Copy link
Member

/azp run maui-pr-uitests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@simonrozsival
Copy link
Member

@copilot I'm seeing this failure in maui-pr-uitests:

src/Controls/src/BindingSourceGen/PathParser.cs(102,5): Error CS1739: The best overload for 'MemberAccess' does not have a parameter named 'IsGetterInaccessible'

Copilot AI and others added 2 commits January 15, 2026 15:32
…ty names

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 15, 2026

@copilot I'm seeing this failure in maui-pr-uitests:

src/Controls/src/BindingSourceGen/PathParser.cs(102,5): Error CS1739: The best overload for 'MemberAccess' does not have a parameter named 'I...

Fixed in 93e4dab. The base branch had added RelayCommand support code that was using the old property names (IsGetterInaccessible, IsSetterInaccessible). I've merged that code with the refactored property names (IsGetterAccessible, IsSetterAccessible).

@simonrozsival
Copy link
Member

/azp run maui-pr,maui-pr-devicetests,maui-pr-uitests

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@simonrozsival
Copy link
Member

/azp run maui-pr,maui-pr-devicetests,maui-pr-uitests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen merged commit 3733513 into net11.0 Jan 19, 2026
168 checks passed
@PureWeen PureWeen deleted the copilot/refactor-member-access-properties branch January 19, 2026 17:55
simonrozsival added a commit that referenced this pull request Jan 20, 2026
- [x] Refactor `IsGetterInaccessible` to `IsGetterAccessible` in
`MemberAccess` record (PathPart.cs)
- [x] Refactor `IsSetterInaccessible` to `IsSetterAccessible` in
`MemberAccess` record (PathPart.cs)
- [x] Update the computed property `HasInaccessibleAccessor` to use the
new properties
- [x] Update `PathParser.cs` to use the new property names (simplified
assignment)
- [x] Update `Setter.cs` to check for `IsSetterAccessible: false`
instead of `IsSetterInaccessible: true`
- [x] Update `AccessExpressionBuilder.cs` to check for
`IsGetterAccessible: false` instead of `IsGetterInaccessible: true`
- [x] Update `BindingCodeWriter.cs` to use the new property names
- [x] Update all test files to use the new property names:
  - [x] `SetterBuilderTests.cs`
  - [x] `BindingRepresentationGenTests.cs`
  - [x] `AccessExpressionBuilderTests.cs`
- [x] Build and verify tests pass (all 119 tests pass)
- [x] Run code review (passed with no comments)
- [x] Run CodeQL security scan (no issues found)
- [x] Fix CI failure by adding missing RelayCommand support code from
base branch (updated to use new property names)

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *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)
> 
> <comments>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #33448

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/dotnet/maui/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: Šimon Rozsíval <simon@rozsival.com>
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants