{"record":{"id":"47c22998e8bcbf7d","repo":"go-delve/delve","slug":"expression-t-not-implemented","errorCode":null,"errorMessage":"expression %T not implemented","messagePattern":"expression %T not implemented","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/evalop/evalcompile.go","lineNumber":427,"sourceCode":"\t\tcase token.LAND:\n\t\t\tsop = &Jump{When: JumpIfFalse, Node: node.X}\n\t\tcase token.LOR:\n\t\t\tsop = &Jump{When: JumpIfTrue, Node: node.X}\n\t\t}\n\t\terr := ctx.compileBinary(node.X, node.Y, sop, &Binary{node})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif sop != nil {\n\t\t\tsop.Target = len(ctx.ops)\n\t\t\tctx.pushOp(&BoolToConst{})\n\t\t}\n\n\tcase *ast.BasicLit:\n\t\tctx.pushOp(&PushConst{constant.MakeFromLiteral(node.Value, node.Kind, 0)})\n\n\tcase *ast.CompositeLit:\n\t\tnotimplerr := fmt.Errorf(\"expression %T not implemented\", t)\n\t\tif ctx.flags&HasDebugPinner == 0 {\n\t\t\treturn notimplerr\n\t\t}\n\t\tdtyp, err := ctx.FindTypeExpr(node.Type)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttyp := godwarf.ResolveTypedef(dtyp)\n\t\tswitch typ := typ.(type) {\n\t\tcase *godwarf.StructType:\n\t\t\tif !ctx.allowCalls {\n\t\t\t\treturn errFuncCallNotAllowedLitAlloc\n\t\t\t}\n\n\t\t\tctx.pushOp(&PushNewFakeVariable{Type: dtyp})\n\n\t\t\tfor i, elt := range node.Elts {\n\t\t\t\tctx.pushOp(&Dup{})","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/evalop/evalcompile.go#L409-L445","documentation":"Composite literals (struct/slice/map literals like T{...} or []int{1,2}) are only supported by Delve's expression evaluator when debug-pinning (function call injection with pinning) is available. compileAST builds a notimplerr for *ast.CompositeLit and returns it immediately unless the HasDebugPinner flag is set in the compile context. Without a pinner, the evaluator cannot allocate memory for the literal, so it refuses to compile the expression.","triggerScenarios":"Evaluating an expression containing a composite literal (e.g. 'print []int{1,2,3}' or 'set m = map[string]int{}') through an API path that did not enable HasDebugPinner — typically non-set evaluations or backends/targets where call injection pinning is unavailable.","commonSituations":"Using 'print' on a literal expression on a target/backend that lacks the pinner facility; evaluating composite literals over gdbserial/core backends where allocation isn't possible; older delve versions or restricted environments.","solutions":["Avoid composite literals in evaluated expressions; construct values step by step using 'set' on individual fields/elements","Use function call injection (a call that builds the value) if the backend supports it, e.g. a helper function in the debugged program","Upgrade/check backend support: pinning works on native backends; on core dumps or gdbserial targets literals cannot be allocated"],"exampleFix":"// before\n(dlv) print []byte{104, 105}\n// after\n(dlv) print s // existing []byte variable, or set individual elements\n(dlv) set s[0] = 104","handlingStrategy":"fallback","validationCode":"// Check for composite literal syntax before evaluating\nif strings.Contains(expr, \"{\") && (strings.Contains(expr, \"[]\") || strings.Contains(expr, \"map[\") || strings.Contains(expr, \"struct{\")) {\n\t// composite literal likely; plan a fallback (variable-based) expression\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Pre-allocate values in program source; debug with existing variables","On backends without pinning, avoid literals entirely","Use call injection with a constructor function as a fallback"],"tags":["debugger","expression-evaluation","composite-literal"],"backgroundTag":"expression-not-implemented","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}