Message Oracle PLS-00508 - The expression in a RETURN statement cannot be a type

ERRORThe expression in a RETURN statement cannot be a type
CAUSEA datatype specifier was used instead of an expression in the RETURN statement of a user-defined function, as shown in the example below. Do not confuse the RETURN statement, which sets the function identifier to the result value, with the RETURN clause, which specifies the datatype of the result value. FUNCTION credit-rating (acct_no NUMBER) RETURN BOOLEAN IS BEGIN ... RETURN NUMBER; -- should be an expression END;
ACTIONReplace the datatype specifier in the RETURN statement with an appropriate expression.