fix: `infer_let` in the kernel

This PR fixes the dead `let` elimination code in the kernel's
`infer_let` function.

Closes #10475
2 files changed