KT-3722: Write correct generic type information for generated fields

 #KT-3722 Fixed