microsoft / microsoft/vscode-java-debug

Evaluation failed when the context is generic method

オープン
#1,169 コメント 1 件 リアクション 4 件 担当者 1 名 GitHub で見る

@testforstephen がすでに取り組んでいます。

2022年5月27日 から。

ai-triaged bug evaluation
主要言語
TypeScript
スター
591
フォーク
429
平均マージ
1日 9時間
マージ済み PR(30日)
19

説明

Ok, I boiled it down to this:

package vscode_bugged;

public class VSCode_Bugged_Example_3 {

    
public static void main(String[] args) {
    foo(tree_builder);
}


static public class Node<T extends Node<T>> {
    public T parent;
}

static public class Tree_Builder<T extends Node<T>> {
    public T current;
}

static public class Element extends Node<Element> {
    public String name;
}

static public Tree_Builder<Element> tree_builder = new Tree_Builder<>();



static public <T extends Node<T>> void foo(Tree_Builder<T> builder) {
    String s = "nope";
    if (builder.current != null) {

    }
    System.out.println(s); // breakpoint here
}

}

It might be possible to boil it down a bit further but my attempts failed so far.
So I think generics might have something to do with it as well.
Place a breakpoint on the last line (see the comment), from there you should be able to see (in the watch window!) tree_builder, builder, s and vscode_bugged.VSCode_Bugged_Example_3.tree_builder but none of them works.

This is not a maven project or the like, just VSCode_Bugged_Example_3.java being located in src/vscode_bugged.

Originally posted by @clankill3r in https://github.com/microsoft/vscode-java-debug/issues/1158#issuecomment-1138320434

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。