diff --git a/Validator/src/main/java/org/openzen/zenscript/validator/visitors/DefinitionMemberValidator.java b/Validator/src/main/java/org/openzen/zenscript/validator/visitors/DefinitionMemberValidator.java index ad992f07..360a16ba 100644 --- a/Validator/src/main/java/org/openzen/zenscript/validator/visitors/DefinitionMemberValidator.java +++ b/Validator/src/main/java/org/openzen/zenscript/validator/visitors/DefinitionMemberValidator.java @@ -100,6 +100,9 @@ public Void visitConstructor(ConstructorMember member) { } } else { checkConstructorForwarded(member); + if(member.isImplicit()) { + ReturnStatementValidator.validate(member.getTargetType(), member.body, validator); + } } return null; @@ -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); } }