groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] 04/04: Check if `objectExpression` instanceof `VariableExpression`
Date Tue, 29 Oct 2019 04:58:35 GMT
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 2a5cf12055ba3020aa6235fb36b006c03186295b
Author: Eric Milles <eric.milles@thomsonreuters.com>
AuthorDate: Tue Oct 29 10:54:55 2019 +0800

    Check if `objectExpression` instanceof `VariableExpression`
---
 .../org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
index b6315bc..92c3c07 100644
--- a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -1590,7 +1590,7 @@ public class StaticTypeCheckingVisitor extends ClassCodeVisitorSupport
{
                 FieldNode field = current.getDeclaredField(propertyName);
                 field = allowStaticAccessToMember(field, staticOnly);
 
-                if (null != field) {
+                if (null != field && objectExpression instanceof VariableExpression)
{
                     int fieldModifiers = field.getModifiers();
                     if (Modifier.isProtected(fieldModifiers) || isPackagePrivate(fieldModifiers))
{
                         TypeCheckingContext.EnclosingClosure enclosingClosure = typeCheckingContext.getEnclosingClosure();


Mime
View raw message