redhat-developer / redhat-developer/vscode-java

Unexpected type mismatch error for Either and Either.Right.

Đang mở
#4,178 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug compile upstream
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:

  1. 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)));
    }
  1. Build
  2. 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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. 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<...>>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

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.