GROOVY-6207: Fix flow typing reset after if branch