Details
-
Bug
-
Resolution: Fixed
-
P3
-
8
-
b82
-
Verified
Description
This program should not compile:
import java.util.ArrayList;
import java.util.List;
interface I {
List<String> [] doit(int x);
}
public class X {
I i1 = ArrayList<String>[]::new; // Compiles OK
I i2 = List<String>[]::new; // Compiles OK
List<String> [] ls = new ArrayList<String>[10]; // Error.
}
import java.util.ArrayList;
import java.util.List;
interface I {
List<String> [] doit(int x);
}
public class X {
I i1 = ArrayList<String>[]::new; // Compiles OK
I i2 = List<String>[]::new; // Compiles OK
List<String> [] ls = new ArrayList<String>[10]; // Error.
}