GROOVY-6401: Method return type inference breaks with inheritance