Improve type error messages for variable assignments
Simplify FlattenCompoundTypes