minor reordering of (let ...) checks to match the order of error reporting in the server compiler