Add type inference for sum destruction