Skip to content

Commit

Permalink
Validate return statements inside implicit constructors and setters
Browse files Browse the repository at this point in the history
  • Loading branch information
kindlich committed Sep 14, 2024
1 parent 55af6be commit 1ccc707
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public Void visitConstructor(ConstructorMember member) {
}
} else {
checkConstructorForwarded(member);
if(member.isImplicit()) {
ReturnStatementValidator.validate(member.getTargetType(), member.body, validator);
}
}

return null;
Expand Down Expand Up @@ -301,6 +304,7 @@ private void validateGetter(GetterMember member, StatementScope scope) {
member.body.accept(statementValidator);

validateThrow(member, new FunctionHeader(member.type), member.body);
ReturnStatementValidator.validate(member.type, member.body, validator);
}
}

Expand Down

0 comments on commit 1ccc707

Please sign in to comment.