GROOVY-6657: Fix generic placeholder type checking