Skip to content

Commit

Permalink
fix type for class expression
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Nov 1, 2024
1 parent 88c6336 commit 74f6866
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ private static Expression tryTransformPrivateFieldAccess(final VariableExpressio

// access to a private field from a section of code that normally doesn't have access to it, like a closure block or inner class
Expression fieldOwner = field.isStatic() ? classX(field.getDeclaringClass()) : propX(classX(field.getDeclaringClass()), "this");
if (!field.isStatic()) fieldOwner.putNodeMetaData(StaticTypesMarker.INFERRED_TYPE, field.getDeclaringClass());
PropertyExpression pe = attrX(fieldOwner, ve.getName()); // GROOVY-10687, GROOVY-11412: direct access
pe.getObjectExpression().putNodeMetaData(StaticTypesMarker.INFERRED_TYPE, field.getDeclaringClass());
pe.putNodeMetaData(StaticTypesMarker.DECLARATION_INFERRED_TYPE, field.getOriginType());
pe.getProperty().setSourcePosition(ve);
return pe;
Expand Down

0 comments on commit 74f6866

Please sign in to comment.