codegen: Simplify field initialization for struct types

Fixes bug 703996