Skip to content

Commit

Permalink
GroovyASTUtils: fix getTypeOfNode() not getting type of field node fr…
Browse files Browse the repository at this point in the history
…om PropertyExpression (closes #76)
  • Loading branch information
joshtynjala committed Jun 26, 2024
1 parent beb1e7c commit 6b6a8a2
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ public static ClassNode getTypeOfNode(ASTNode node, ASTNodeVisitor astVisitor) {
if (propNode != null) {
return getTypeOfNode(propNode, astVisitor);
}
FieldNode fieldNode = GroovyASTUtils.getFieldFromExpression(expression, astVisitor);
if (fieldNode != null) {
return getTypeOfNode(fieldNode, astVisitor);
}
return expression.getType();
} else if (node instanceof Variable) {
Variable var = (Variable) node;
Expand Down

0 comments on commit 6b6a8a2

Please sign in to comment.