jextract/jni: Overloads with protocol parameters generate duplicate adapter classes
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 53/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start by reading the JNI extraction path that emits protocol-parameter adapters when enableJavaCallbacks is enabled; the issue does not name a file or test, so locate it from that option and the generated adapter name. Reproduce with the two Client initializers in the issue and inspect generated Swift for duplicate class declarations. Done when overloaded initializers, instance methods, and free functions that need the same adapter generate compilable Swift.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
With enableJavaCallbacks enabled, JNI extraction emits a protocol-parameter adapter for each function declaration. Overloads with the same function name, parameter name, and enclosing type can require the same adapter, so the generated Swift contains duplicate class declarations and fails to compile.
Example
Both initializers below generate an adapter with the same name for store:
public protocol Store {
func value() -> Int64
}
public struct Client {
public init(store: some Store) {}
public init(store: some Store, extra: Int64) {}
}
The duplicate adapter declarations cause the generated Swift to fail compilation. The same problem can occur with overloaded instance methods and free functions.
Reference workaround implementation: https://github.com/qoncept/swift-java/pull/9
- Ngôn ngữ chính
- Swift
- Star
- 1.3k
- Fork
- 127
- Merge trung bình
- 2 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của swiftlang/swift-java
-
wrap-java: Optional convenience methods can fail to compile when a parameter shadows the method nameĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
swiftlang/swift-java#945 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
android
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
swiftlang/swift-java#663 · 4 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
swiftlang/swift-java#949 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
swiftlang/swift-java#948 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 54/100
swiftlang/swift-java#947 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của swiftlang/swift-java
Issue tương tự
-
🎉 Add OmuType to Input MethodsĐang mởaddition
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
jaywcjlove/awesome-mac#4259 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
VictorKildahl/cra#192 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:docs phase:release priority:p0 type:test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openwallet-foundation/multipaz#2161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug Accessibility Notifications
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
wordpress-mobile/WordPress-iOS#26340 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày