Repository navigation
Conversation
…ions 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. - Deduplicate refined requirements across inherited protocols in allProtocolRequirementMethods. - Add regression tests covering default implementations, differing parameter names, overloads, non-throwing default implementations, and non-requirement extension members.
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.
Summary
Fixes swiftlang#891 by distinguishing genuine protocol requirements from default implementations in
SwiftExtract(at requirement collection time) rather than deduplicating during code generation:ExtractedNominalType:methodsandvariablesexclusively store true protocol requirements declared in the protocol definition.protocolDefaultImplementations.protocolExtensionMethods/protocolExtensionVariables.ExtractedNominalType.satisfiesProtocolRequirement(candidate:requirement:)andfindProtocolRequirement(satisfying:in:).allProtocolRequirementMethods, deduplicate refined requirements across inherited protocols using breadth-first traversal andsatisfiesProtocolRequirement.JNIProtocolTestscovering unique existential box dispatch thunks, Java methods, differing parameter names, overloads, non-throwing default implementations, callback wrappers, non-requirement extension methods, and get-only property setters.Testing
swift test --filter JNIProtocolTests(25/25 passed)swift test --filter SwiftExtractTests(91/91 passed)swift test --filter JExtractSwiftTests(607/607 passed)xcrun swift-format lint --configuration .swift-formatclean