Repository navigation
Checker: fix stale type subsumption cache entries - #21026
Open
auduchinok wants to merge 1 commit into
Open
auduchinok wants to merge 1 commit into
auduchinok wants to merge 1 commit into
Conversation
Contributor
✅ Release notes checked
|
The type subsumption cache remembered whether one type is a supertype of another, but the supertypes and interfaces of a type are only final once the file declaring it has been checked. A record, union or struct gets its equality and comparison interfaces after the members of its recursive group are checked, so a question asked inside the group cached "no" and later checks got that answer back. Valid code then failed with FS0363, or an overload was chosen as if the interface were missing. The cache is now only used when the type whose supertypes are searched has been closed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
auduchinok
force-pushed
the
checker-subsumptionCacheOpenTypes
branch
from
November 24, 2026 16:29
629c3c5 to
4a6a3d0
Compare
abonie
approved these changes
Nov 27, 2026
This branch has not been deployed
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.
This fails with FS0363 (“The interface ‘System.IEquatable‘ is included in multiple explicitly implemented interface types”) at
--langversion:10.0. A record gets its equality interfaces after the members of its recursive group are checked, so the call inInsidecaches “Item is not an IEquatable” and the later interface check gets that answer back.The type subsumption cache is now only used when the type whose supertypes are searched has been closed, which is when its supertypes and interfaces are final.
At the default language version the same source currently fails with FS0001 instead, from the overload resolution cache; that is fixed separately in checker-overloadCacheTyArgs.