Repository navigation
Conversation
|
This seems to be fixing the symptom and not the problem itself? We should insttead fix how requirements are collected maybe? |
|
|
||
| let protocolDefaultImplementationSource = """ | ||
| public protocol Test { | ||
| public func action() |
There was a problem hiding this comment.
this isn't valid swift tbh, can't have the public here
There was a problem hiding this comment.
fixed, sorry for this bug
| /// function (including requirements inherited from refined protocols). | ||
| private func printExistentialBoxDispatchThunks(_ printer: inout SwiftPrinter, _ type: ExtractedNominalType) { | ||
| let boxParentName = SwiftQualifiedTypeName(type.swiftNominal.javaExistentialBoxName) | ||
| var emittedCDeclSymbols: Set<String> = [] |
There was a problem hiding this comment.
This seems a bit hacky, like fixing the symptom rathe rthan maybe identify them differently to begin with?
There was a problem hiding this comment.
Moved the deduplication upstream to uniqueProtocolRequirements, so both Swift thunks and Java bindings use the deduplicated protocol requirements.
I also added signature normalization and regression tests to cover cases like different parameter names, overloads, and a non-throwing default implementation satisfying a throwing requirement.
- Move deduplication logic into allProtocolRequirementMethods so both Swift thunks and Java bindings are deduplicated. - Include apiKind in the deduplication key to avoid dropping property setters. - Remove redundant emission-level deduplication and dead helper code. - Fix invalid 'public' modifier in test extensions (thanks @ktoso). - Add test for Java-side existential box deduplication.
|
Update PR title and description for current implementation. |
Summary
Fixes #891
Testing
swift test --filter JNIProtocolTestsswift test --filter JExtractSwiftTestsxcrun swift-format lint --configuration .swift-formaton changed Swift files