Revert "Fix: error in code generation when using reflection and non-primitive"

This reverts commit 1dffb8b7cbc52686d6a74a82f6a0e45778757b84.
Fix: error in code generation when using reflection and non-primitive