Skip to content

Commit

Permalink
Merge branch 'master' into renovate/org.mockito-mockito-core-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
konradweiss authored Nov 28, 2020
2 parents 9b08687 + 0192552 commit e8fac90
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,15 @@ private Expression handleSimpleTypeConstructorExpression(
private Expression handleFieldReference(CPPASTFieldReference ctx) {
Expression base = this.handle(ctx.getFieldOwner());
// Replace Literal this with a reference pointing to this
if (base instanceof Literal && ((Literal) base).getValue().equals("this")) {
if (base instanceof Literal && ((Literal<?>) base).getValue().equals("this")) {
PhysicalLocation location = base.getLocation();

var record = lang.getScopeManager().getCurrentRecord();

base =
NodeBuilder.newDeclaredReferenceExpression(
"this",
lang.getScopeManager().getCurrentRecord().getThis().getType(),
record != null ? record.getThis().getType() : UnknownType.getUnknownType(),
base.getCode());
base.setLocation(location);
}
Expand Down

0 comments on commit e8fac90

Please sign in to comment.