redhat-developer / redhat-developer/vscode-java

Unexpected type mismatch error for Either and Either.Right.

未关闭
#4,178 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug compile upstream
主要语言
TypeScript
星标
2.3k
派生
547
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用列出的 Java 和 Language Support for Java 版本,在 VS Code 中重现报告的 Java 代码片段,然后将结果与 mvn compile 及其他 IDE 进行比较。当扩展在此情况下不再报告 Mono<Either.Right<...>>Mono<Either<...>> 之间的类型不匹配时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, typescript
领域
devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。