Skip containing type accessibility check when resolving overridden members#82164
Closed
Skip containing type accessibility check when resolving overridden members#82164
Conversation
…TDetermination Co-authored-by: AlekseyTs <10522107+AlekseyTs@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix assertion failure in MakeFinalIVTDetermination
Skip containing type accessibility check when resolving overridden members
Jan 27, 2026
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
AlekseyTs
reviewed
Feb 12, 2026
| } | ||
|
|
||
| [Fact] | ||
| public void PropertyIsReadOnly_WithTypeArgumentFromUnrelatedAssembly() |
Contributor
Author
There was a problem hiding this comment.
Added VB test in commit 1d31135. The test follows the same pattern as the C# version and verifies that checking PropertySymbol.IsReadOnly doesn't trigger an assertion when the containing type has type arguments from unrelated assemblies.
…assembly Co-authored-by: AlekseyTs <10522107+AlekseyTs@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Contributor
|
The added test doesn't exhibit the problem |
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.
Assertion in
MakeFinalIVTDeterminationtriggered when callingPropertySymbol.IsReadOnlyon properties in types with type arguments from unrelated assemblies. TheGetLeastOverriddenPropertymethod walks the override chain and checks accessibility of each overridden member, but incorrectly performedIsNamedTypeAccessiblechecks on containing types, attempting to verify type arguments that may be from assemblies outside the reference graph.Changes
skipContainingTypeCheckparameter to bypassIsNamedTypeAccessiblecheck inIsMemberAccessiblewhen checking overridden membersskipContainingTypeCheck: trueinGetLeastOverriddenPropertyskipContainingTypeCheck: trueinGetLeastOverriddenEventskipContainingTypeCheck: trueinGetLeastOverriddenMethodCoreExample
When resolving the least overridden member, we only need to verify the member's accessibility, not whether the containing type's type arguments are accessible from the current context.
Original prompt
This section details on the original issue you should resolve
<issue_title>Assertion failed: Unrelated assembly in MakeFinalIVTDetermination</issue_title>
<issue_description>Version Used:
675c2b9
Steps to Reproduce:
On an internal repo in VSCode, running from a local debug build at 675c2b9 with full solution analysis (compiler and analyzers) enabled, an assertion is thrown (below) and the server crashes (however sometimes it hits different assertions and crashes)
Dump - https://microsoft-my.sharepoint.com/:u:/p/dabarbet/IQAdpq7L947ERLD4fHEUdlg3AZf9VaJtyiDpSRjvMNvG2tg?e=ykQAa7 (internal only, macOS arm64 dump)
Expected Behavior:
No assertion
Actual Behavior: