Add error message for unmatched types from branches
Add test for different types from branches