Skip to content

Commit

Permalink
Rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored Nov 25, 2024
1 parent 58dd4b5 commit e6aa0ff
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2260,21 +2260,21 @@ public Void visitReturn(ReturnTree tree, Void p) {

Tree enclosing = TreePathUtil.enclosingOfKind(getCurrentPath(), methodAndLambdaExpression);

AnnotatedTypeMirror ret = null;
AnnotatedTypeMirror declaredReturnType = null;
if (enclosing.getKind() == Tree.Kind.METHOD) {
MethodTree enclosingMethod = (MethodTree) enclosing;
boolean valid = validateTypeOf(enclosingMethod);
if (valid) {
ret = atypeFactory.getMethodReturnType(enclosingMethod, tree);
declaredReturnType = atypeFactory.getMethodReturnType(enclosingMethod, tree);
}
} else {
AnnotatedExecutableType result =
atypeFactory.getFunctionTypeFromTree((LambdaExpressionTree) enclosing);
ret = result.getReturnType();
declaredReturnType = result.getReturnType();
}

if (ret != null) {
commonAssignmentCheck(ret, tree.getExpression(), "return");
if (declaredReturnType != null) {
commonAssignmentCheck(declaredReturnType, tree.getExpression(), "return");
}
return super.visitReturn(tree, p);
}
Expand Down

0 comments on commit e6aa0ff

Please sign in to comment.