diff --git a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/InnerClassTests.java b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/InnerClassTests.java index 9cabe09aea..13261029f7 100644 --- a/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/InnerClassTests.java +++ b/base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/InnerClassTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2021 the original author or authors. + * Copyright 2009-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -300,8 +300,28 @@ public void testInnerClass5() { runConformTest(sources); } - @Test // https://github.com/groovy/groovy-eclipse/issues/708 + @Test // GROOVY-8715 public void testInnerClass6() { + //@formatter:off + String[] sources = { + "p/Script.groovy", + "package p\n" + + "Outer.Inner[] array\n", + + "p/Outer.groovy", + "package p\n" + + "class Outer {\n" + + " static class Inner {\n" + + " }\n" + + "}\n", + }; + //@formatter:on + + runConformTest(sources); + } + + @Test // https://github.com/groovy/groovy-eclipse/issues/708, GROOVY-10455 + public void testInnerClass7() { //@formatter:off String[] sources = { "Script.groovy", @@ -328,7 +348,7 @@ public void testInnerClass6() { } @Test - public void testInnerClass7() { + public void testInnerClass8() { //@formatter:off String[] sources = { "Script.groovy", @@ -350,7 +370,7 @@ public void testInnerClass7() { } @Test // GROOVY-8947 - public void testInnerClass8() { + public void testInnerClass9() { assumeTrue(isParrotParser()); //@formatter:off @@ -374,7 +394,7 @@ public void testInnerClass8() { } @Test - public void testInnerClass9() { + public void testInnerClass10() { //@formatter:off String[] sources = { "Script.groovy", @@ -397,7 +417,7 @@ public void testInnerClass9() { } @Test // GROOVY-10289 - public void testInnerClass10() { + public void testInnerClass11() { //@formatter:off String[] sources = { "Script.groovy", diff --git a/base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/JDTResolver.java b/base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/JDTResolver.java index 2830f546b0..7bb10efef7 100644 --- a/base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/JDTResolver.java +++ b/base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/JDTResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2021 the original author or authors. + * Copyright 2009-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -457,6 +457,8 @@ protected boolean resolveToOuter(ClassNode type) { protected boolean resolveToInner(ClassNode type) { ModuleNode module = currentClass.getModule(); if (module != null) { + while (type.isArray()) type = type.getComponentType(); //GROOVY-8715 + String name = type.getName(); int i = name.lastIndexOf('.'); if (i > 0 && module.hasPackageName()) {