redhat-developer / redhat-developer/vscode-java
Unexpected type mismatch error for Either and Either.Right.
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 546
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
VSCode Version: 1.99.3
macOS: 26.0 (25A354)
Language Support for Java(TM) by Red Hat v1.45.0
Java Version: Zulu 17.60 (but I was able to repro on multiple versions
vs code won't build the project reporting the code issue as Type mismatch for Either vs Either.Right. Either.Right is a derived class from Either.
When building with mvn compile or with other IDEs this code works just fine.
Steps to Reproduce:
- Create a function
public <R> Mono<Either<Throwable, ResponseEntity<List<SimpleProductTileV2>>>> noOfferProductDetails(
BffRequestContext<R> requestContext) {
// No liam return empty list of products
return Mono.just(new Either.Right<>(new ResponseEntity<>(Collections.<SimpleProductTileV2>emptyList(), HttpStatus.OK)));
}
- Build
- Get error
Type mismatch: cannot convert from Mono<Either.Right<ResponseEntity<List<SimpleProductTileV2>>>> to Mono<Either<Throwable,ResponseEntity<List<SimpleProductTileV2>>>>
mvn compile works just fine
Looks like vs code compiler incorrectly decode Either.Right or something like that.
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.
Hướng nghiên cứu
Tái hiện đoạn mã Java được báo cáo trong VS Code bằng cách sử dụng các phiên bản Java và Language Support for Java được liệt kê, sau đó so sánh kết quả với mvn compile và các IDE khác. Được xem là hoàn tất khi extension không còn báo lỗi không tương thích kiểu giữa Mono<Either.Right<...>> và Mono<Either<...>> đối với trường hợp này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, typescript
- Lĩnh vực
- devtools
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100