Prevent unused result warning in codegen. Always expect success for now.

Is it reasonable to always expect success here for now?

Fixes #2246.