--- a/langtools/test/jdk/jshell/VariablesTest.java Wed Jul 05 21:07:43 2017 +0200
+++ b/langtools/test/jdk/jshell/VariablesTest.java Fri Dec 11 11:20:10 2015 -0800
@@ -23,6 +23,7 @@
/*
* @test
+ * @bug 8144903
* @summary Tests for EvaluationState.variables
* @build KullaTesting TestingInputStream ExpectedDiagnostic
* @run testng VariablesTest
@@ -184,6 +185,16 @@
assertActiveKeys();
}
+ public void variablesTemporaryArrayOfCapturedType() {
+ assertEval("class Test<T> { T[][] get() { return null; } }", added(VALID));
+ assertEval("Test<? extends String> test() { return new Test<>(); }", added(VALID));
+ assertEval("test().get()", added(VALID));
+ assertVariables(variable("String[][]", "$1"));
+ assertEval("\"\".getClass().getEnumConstants()", added(VALID));
+ assertVariables(variable("String[][]", "$1"), variable("String[]", "$2"));
+ assertActiveKeys();
+ }
+
public void variablesClassReplace() {
assertEval("import java.util.*;", added(VALID));
Snippet var = varKey(assertEval("List<Integer> list = new ArrayList<>();", "[]",