GROOVY-6782: Fix subscript operator compilation in case of flow typing changing the type of the object