improve support for "Sum" types