{"record":{"id":"727e58eeb578379d","repo":"apache/beam","slug":"bind-conflict-for-v-v-v","errorCode":null,"errorMessage":"bind conflict for %v: %v != %v","messagePattern":"bind conflict for (.+?): (.+?) != (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/funcx/signature.go","lineNumber":174,"sourceCode":"\t}\n\tif err := matchOpt(in[:off], sig.OptArgs, m); err != nil {\n\t\treturn err\n\t}\n\tif err := matchReq(out[:len(sig.Return)], sig.Return); err != nil {\n\t\treturn err\n\t}\n\treturn matchOpt(out[len(sig.Return):], sig.OptReturn, m)\n}\n\nfunc bind(list, models []reflect.Type, m map[string]reflect.Type) error {\n\tfor i, t := range models {\n\t\tif !typex.IsUniversal(list[i]) {\n\t\t\tcontinue\n\t\t}\n\n\t\tname := list[i].Name()\n\t\tif current, ok := m[name]; ok && current != t {\n\t\t\treturn errors.Errorf(\"bind conflict for %v: %v != %v\", name, current, t)\n\t\t}\n\t\tm[name] = t\n\t}\n\treturn nil\n}\n\nfunc matchReq(list, models []reflect.Type) error {\n\tfor i, t := range list {\n\t\tif typex.IsUniversal(t) {\n\t\t\tcontinue // ok: if this was bad, there would be a bind conflict\n\t\t}\n\n\t\tmodel := models[i]\n\t\tif t.Kind() == reflect.Interface && model.Implements(t) {\n\t\t\tcontinue\n\t\t}\n\t\tif model != t {\n\t\t\treturn &TypeMismatchError{Got: t, Want: model}","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/funcx/signature.go#L156-L192","documentation":"During generic binding in Satisfy (helper 'bind'), each universal (generic) type parameter is mapped by name to a concrete reflect.Type. This error is returned when the same generic type name would need to bind to two different concrete types, which would make the substitution inconsistent.","triggerScenarios":"Calling Satisfy with a function where one named generic (e.g. X) appears in multiple parameter or return positions that have different concrete types, e.g. fn func(A, B) (int, error) where A and B both refer to generic X.","commonSituations":"DoFn methods that process input of one type but emit a mismatched output type while the signature declares them as the same generic; typos in type parameters causing two generics to share a name; passing mixed-type collections (e.g. KV<A,B>) where a single type was expected.","solutions":["Make the types consistent so every occurrence of a generic name binds to the same concrete type.","If the types are genuinely different, use distinct generic type names in the Signature.","Check the inputs/outputs being fed to the function; ensure upstream producers emit the declared type."],"exampleFix":"// before\nfunc process(kv KV<X, X>) ... // KV<int,string> input: X binds to both int and string -> conflict\n// after\nfunc process(kv KV<X, Y>) ... // use two distinct generics","handlingStrategy":"validation","validationCode":"in, out := fnTypeParams(fn)\nbindings := map[string]reflect.Type{}\nfor _, t := range append(in, out...) {\n    if name := genericName(t); name != \"\" {\n        if prev, ok := bindings[name]; ok && prev != t {\n            return fmt.Errorf(\"generic %s bound to both %v and %v\", name, prev, t)\n        }\n        bindings[name] = t\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure every generic type name binds to exactly one concrete type across parameters and returns.","Use distinct variable names (X, Y) for differing input/output types.","Check upstream PCollection element types match the declared generic."],"tags":["go","beam","generics","type-binding"],"backgroundTag":"type-mismatch","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}