blackdrag commented on code in PR #3227:
URL: https://github.com/apache/groovy/pull/3227#discussion_r4530553184
##########
src/main/java/org/codehaus/groovy/control/ResolveVisitor.java:
##########
@@ -750,7 +750,7 @@ protected boolean resolveFromDefaultImports(final ClassNode
type, final String[]
// WARNING: This code does not expect a class that has a static
// inner class in DEFAULT_IMPORTS
ConstructedClassWithPackage tmp = new
ConstructedClassWithPackage(packagePrefix, typeName);
- if (resolve(tmp, false, false, false)) {
+ if (resolve(tmp, false, false, false) &&
isStarImportAccessible(tmp, null)) {
Review Comment:
let assume we have 3 star imports. a.*, b.* and c.*, where a is a default
import And we look for a class X
| a | b | c| result |
| --- | --- | ---| --- |
|(not) accessible | (not) accessible| (not) accessible| ambiguous class name
error|
| - | (not) accessible| (not) accessible|ambiguous class name error|
| (not) accessible | -| (not) accessible|resolved to c.X, error if not
accessible|
| -/(not) accessible | (not) accessible|-|resolved to b.X, error if not
accessible|
|(not) accessible|-|-|resolved to a.X, error if not accessible|
I assume we follow that?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]