visitReturnStmt method
Implementation
@override
void visitReturnStmt(Stmt.Return stmt) {
if (currentFunctionType == FunctionType.NONE) {
error1(stmt.keyword, 'Can not return from top-level code.');
}
if (stmt.value != null) {
if (currentFunctionType == FunctionType.INITIALIZER) {
error1(stmt.keyword, 'Can not return a value from an initializer.');
}
resolveExpr(stmt.value!);
}
return;
}