{"record":{"id":"01235fdb98ed33c6","repo":"go-delve/delve","slug":"unimplemented-comparison-of-s-variables","errorCode":null,"errorMessage":"unimplemented comparison of %s variables","messagePattern":"unimplemented comparison of (.+?) variables","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/eval.go","lineNumber":2684,"sourceCode":"\t\teql, err = equalChildren(xv, yv, true)\n\tcase reflect.Struct:\n\t\tif len(xv.Children) != len(yv.Children) {\n\t\t\treturn false, nil\n\t\t}\n\t\tif int64(len(xv.Children)) != xv.Len || int64(len(yv.Children)) != yv.Len {\n\t\t\treturn false, errors.New(\"structure too deep for comparison\")\n\t\t}\n\t\teql, err = equalChildren(xv, yv, false)\n\tcase reflect.Slice, reflect.Map, reflect.Func, reflect.Chan:\n\t\treturn false, fmt.Errorf(\"can not compare %s variables\", xv.Kind.String())\n\tcase reflect.Interface:\n\t\tif xv.Children[0].RealType.String() != yv.Children[0].RealType.String() {\n\t\t\teql = false\n\t\t} else {\n\t\t\teql, err = compareOp(token.EQL, &xv.Children[0], &yv.Children[0])\n\t\t}\n\tdefault:\n\t\treturn false, fmt.Errorf(\"unimplemented comparison of %s variables\", xv.Kind.String())\n\t}\n\n\tif op == token.NEQ {\n\t\treturn !eql, err\n\t}\n\treturn eql, err\n}\n\nfunc (v *Variable) isNil() bool {\n\tswitch v.Kind {\n\tcase reflect.Ptr:\n\t\treturn v.Children[0].Addr == 0\n\tcase reflect.Interface:\n\t\treturn v.Children[0].Addr == 0 && v.Children[0].Kind == reflect.Invalid\n\tcase reflect.Slice, reflect.Map, reflect.Func, reflect.Chan:\n\t\treturn v.Base == 0\n\t}\n\treturn false","sourceCodeStart":2666,"sourceCodeEnd":2702,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/eval.go#L2666-L2702","documentation":"This is compareOp's fallback for kinds without a dedicated equality implementation: any kind not explicitly handled (numeric, string, bool, ptr, complex, struct, array, interface, etc.) lands in the default branch and reports an unimplemented comparison. It signals a gap in Delve's evaluator rather than a rule of the Go language.","triggerScenarios":"Comparing variables whose Kind is not among the kinds compareOp implements, e.g. certain unsafe/complex or unusual kinds reached after type negotiation, via `p x == y`.","commonSituations":"Exotic or internal runtime types surfacing in an expression, or a Delve version lacking support for a newly added kind; users comparing values that a newer Delve could handle.","solutions":["Compare the underlying representation instead: cast fields or compare components individually.","Upgrade Delve — support for more kinds is added over time.","File a bug with the type/kind if the comparison should be supported."],"exampleFix":"// before\np x == y   // unimplemented kind\n// after\np x.field == y.field","handlingStrategy":"fallback","validationCode":"// stick to kinds Delve implements: numbers, strings, bools, ptrs, complex, struct, array, interface\n// otherwise compare components individually","typeGuard":"func implementedComparison(k reflect.Kind) bool {\n    switch k {\n    case reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,\n        reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,\n        reflect.Uintptr, reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128,\n        reflect.String, reflect.Ptr, reflect.UnsafePointer, reflect.Struct, reflect.Array, reflect.Interface:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Compare known-good kinds (numbers, strings, pointers) only.","Break exotic values into fields and compare those.","Keep Delve up to date; unimplemented kinds shrink over time."],"tags":["debugger","expression-evaluation","unimplemented"],"backgroundTag":"unimplemented-comparison","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}