The method is ambiguous for the type
@snjeza がすでに取り組んでいます。
2025年3月4日 から。
評価
この issue はまだ評価されていません。
説明
Type: Bug
VS Code is showing error for this code snippet that standard javac has no problem with. It's a combination of having overload methods accepting two different interfaces and a lambda expression that's using while loop.
public class Test {
public static void main(String[] args) throws Exception {
System.out.println("Hello, World!");
test(x -> {
while (x.length() > 0) {
System.out.println(x);
x = x.substring(1);
}
});
}
public static void test(Consumer<String> consumer) {
consumer.accept("Hello, World!");
}
public static void test(Function<String, Integer> function) {
System.out.println(function.apply("Hello, World!"));
}
public interface Consumer<T> {
void accept(T t);
}
public interface Function<T, R> {
R apply(T t);
}
}
Error: The method test(Test.Consumer) is ambiguous for the type Test
Extension version: 1.39.0
VS Code version: Code 1.96.4 (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS version: Linux x64 5.4.0-205-generic
Modes:
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 547
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
redhat-developer/vscode-java のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
redhat-developer/vscode-java#4426 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
redhat-developer/vscode-java#4506 · コメント 3 件 · リアクション 4 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
redhat-developer/vscode-java#4505 · コメント 2 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
redhat-developer/vscode-java#4504 · コメント 3 件 · リアクション 1 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
redhat-developer/vscode-java#4502 ·
redhat-developer/vscode-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
0xMiden/bridge-portal#132 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
area:tools bug good first issue help wanted priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
TaewoooPark/Motifcode#14 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
newrelic-experimental/preflight#793 · コメント 1 件 ·