Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0-alpha-3, 2.5.0, 3.0.0, 3.0.1
-
None
-
None
Description
Two files in the 'pkg' package:
MyClass.groovy
package pkg class HasClass { static class MyClass {} }
HasClass.groovy
package pkg private static void foo(HasClass.MyClass... val) {} //pkg.HasClass.MyClass[] val // Also Fails //pkg.HasClass.MyClass val // Does not fail
Results in the following error:
/home/ianl/IdeaProjects/VariousGroovy/src/main/groovy/pkg/UsesClass.groovy: 3: unable to resolve class HasClass.MyClass[] @ line 3, column 25. private static void foo(HasClass.MyClass... val) {} ^
This fails only for arrays, not single references. It does not occur if the files are in the default package.
It is also possible to work around it with a static import:
HasClass.groovy
package pkg import static HasClass.MyClass // Now it doesn't fail private static void foo(MyClass... val) {}