Skip to content

Commit

Permalink
GROOVY-8715
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Jan 20, 2022
1 parent 774c722 commit 6b4f5d2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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",
Expand All @@ -328,7 +348,7 @@ public void testInnerClass6() {
}

@Test
public void testInnerClass7() {
public void testInnerClass8() {
//@formatter:off
String[] sources = {
"Script.groovy",
Expand All @@ -350,7 +370,7 @@ public void testInnerClass7() {
}

@Test // GROOVY-8947
public void testInnerClass8() {
public void testInnerClass9() {
assumeTrue(isParrotParser());

//@formatter:off
Expand All @@ -374,7 +394,7 @@ public void testInnerClass8() {
}

@Test
public void testInnerClass9() {
public void testInnerClass10() {
//@formatter:off
String[] sources = {
"Script.groovy",
Expand All @@ -397,7 +417,7 @@ public void testInnerClass9() {
}

@Test // GROOVY-10289
public void testInnerClass10() {
public void testInnerClass11() {
//@formatter:off
String[] sources = {
"Script.groovy",
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 6b4f5d2

Please sign in to comment.