--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java Thu Nov 22 11:15:53 2018 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTrees.java Thu Nov 22 15:38:20 2018 +0100
@@ -443,7 +443,11 @@
// we first check if qualifierExpression identifies a type,
// and if not, then we check to see if it identifies a package.
Type t = attr.attribType(ref.qualifierExpression, env);
- if (t.isErroneous()) {
+
+ if (t.getKind() == TypeKind.ARRAY) {
+ // cannot refer to an array type
+ return null;
+ } else if (t.isErroneous()) {
JCCompilationUnit toplevel =
treeMaker.TopLevel(List.nil());
final ModuleSymbol msym = modules.getDefaultModule();
@@ -451,6 +455,9 @@
toplevel.packge = msym.unnamedPackage;
Symbol sym = attr.attribIdent(ref.qualifierExpression, toplevel);
+ if (sym == null)
+ return null;
+
sym.complete();
if ((sym.kind == PCK || sym.kind == TYP) && sym.exists()) {