GROOVY-6856: fix context generics for return type inference