public function resolve($result, CompilationContext $compilationContext)
    {
        if ($this->code instanceof \Closure) {
            $code = $this->code;
            if (!$result) {
                $tempVariable = $compilationContext->symbolTable->getTempVariableForWrite(
                    'variable',
                    $compilationContext
                );
                $compilationContext->codePrinter->output($code($tempVariable->getName()));
                $tempVariable->setIsInitialized(true, $compilationContext);

                return $tempVariable->getName();
            }

            return $code($result);
        }

        return $this->code;
    }