Generated dependent fields if they are of a union type.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>