GROOVY-6127: Usage of flow typing leads to incorrect type of local variables in conditional branches