What could be nice is the developer providing some unit tests, and Second using those to ensure the PR is functional, re-generating if not.
Given a set of tests, I guess you could try to generate the code as well, though I could imagine it might overfit on the given tests and create a "hack" solution.