Skip to content

Commit 6b6a8a2

Browse files
committed
GroovyASTUtils: fix getTypeOfNode() not getting type of field node from PropertyExpression (closes #76)
1 parent beb1e7c commit 6b6a8a2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/net/prominic/groovyls/compiler/util/GroovyASTUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ public static ClassNode getTypeOfNode(ASTNode node, ASTNodeVisitor astVisitor) {
234234
if (propNode != null) {
235235
return getTypeOfNode(propNode, astVisitor);
236236
}
237+
FieldNode fieldNode = GroovyASTUtils.getFieldFromExpression(expression, astVisitor);
238+
if (fieldNode != null) {
239+
return getTypeOfNode(fieldNode, astVisitor);
240+
}
237241
return expression.getType();
238242
} else if (node instanceof Variable) {
239243
Variable var = (Variable) node;

0 commit comments

Comments
 (0)