Repository navigation
SwiftExtract: distinguish protocol requirements from default implementations and extension members - #934
Open
Hokila wants to merge 1 commit into
Open
SwiftExtract: distinguish protocol requirements from default implementations and extension members #934Hokila wants to merge 1 commit into
Hokila wants to merge 1 commit into
Conversation
…tations and extension members - Fixes swiftlang#891 at collection time by distinguishing genuine protocol requirements from default implementations and extension members in SwiftExtract. - Defer unconstrained protocol extensions until all nominal declarations are visited, ensuring all requirements are populated before matching default implementations. - Record default implementations in ExtractedNominalType.protocolDefaultImplementations and non-requirement extension members in protocolExtensionMethods / protocolExtensionVariables. - Add regression tests covering default implementations and extension members.
Hokila
force-pushed
the
fix-891-swift-extract-requirements
branch
from
October 16, 2026 00:45
a7ad721 to
99645f6
Compare
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.
Fixes #891 (replace #916).
SwiftExtractto separate members into three distinct categories:protocol requirements,default implementations, andextension members, instead of directly appending extensions to ExtractedNominalType.methods.protocolExtensionMethods / protocolExtensionVariables.supportedProtocolRequirementsto avoid cache poisoning caused by premature method name caching intranslatedDecl(for:).Testing
• swift test --filter JNIProtocolTests
• swift test --filter SwiftExtractTests