Skip to content

Fix type inferencing and syntax highlighting for other-package reference to package-private field #1575

@eric-milles

Description

@eric-milles

Consider the following:

package foo;
public class Bar {
  Object packagePrivate;
}
package foo;
public class Baz extends Bar {
}
def pojo = new foo.Baz()
pojo.packagePrivate

Since C and D are in the same package, Groovy (since 2.4) propagates the field to the meta-info index of D. Therefore, a class/script from another package can access "field". However, highlighting is shoring as unknown (underlined).

image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions