{"record":{"id":"cbca9fc5a34f4241","repo":"apache/beam","slug":"type-v-of-kind-v-not-permitted-in-concrete-types-all-types","errorCode":null,"errorMessage":"Type \"%v\" of kind \"%v\" not permitted in concrete types. All types must be manageable.","messagePattern":"Type \"(.+?)\" of kind \"(.+?)\" not permitted in concrete types\\. All types must be manageable\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/typex/class.go","lineNumber":132,"sourceCode":"\t}\n\tvisited[t] = true\n\n\t// Handle special types.\n\tif t == nil ||\n\t\tt == EventTimeType ||\n\t\tt.Implements(WindowType) ||\n\t\tt == PaneInfoType ||\n\t\tt == TimersType ||\n\t\tt == BundleFinalizationType ||\n\t\tt == reflectx.Error ||\n\t\tt == reflectx.Context ||\n\t\tIsUniversal(t) {\n\t\treturn errors.Errorf(\"Special type \\\"%v\\\" not permitted in concrete types\", t)\n\t}\n\n\tswitch t.Kind() {\n\tcase reflect.Invalid, reflect.UnsafePointer, reflect.Uintptr:\n\t\treturn errors.Errorf(\"Type \\\"%v\\\" of kind \\\"%v\\\" not permitted in concrete types. All types must be manageable.\", t, t.Kind()) // no unmanageable types\n\n\tcase reflect.Chan, reflect.Func:\n\t\treturn errors.Errorf(\"Type \\\"%v\\\" of kind \\\"%v\\\" not permitted in concrete types. All types must be serializable.\", t, t.Kind()) // no unserializable types\n\n\tcase reflect.Map:\n\t\terr := isConcrete(t.Elem(), visited)\n\t\tif err == nil {\n\t\t\terr = isConcrete(t.Key(), visited)\n\t\t}\n\t\tif err != nil {\n\t\t\terr = errors.Wrapf(err, \"Nested type in map \\\"%v\\\" not permitted in concrete types.\", t)\n\t\t}\n\t\treturn err\n\n\tcase reflect.Array, reflect.Slice, reflect.Ptr:\n\t\terr := isConcrete(t.Elem(), visited)\n\t\tif err != nil {\n\t\t\terr = errors.Wrapf(err, \"Nested type in %v \\\"%v\\\" not permitted in concrete types.\", t.Kind(), t)","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/typex/class.go#L114-L150","documentation":"isConcrete rejects element types whose Go kind is unmanageable: Invalid (nil/zero reflect.Type), UnsafePointer, or Uintptr. Beam cannot serialize, hash, or otherwise manage elements of these kinds, so any concrete type graph containing them is rejected. Reached via IsConcrete/CheckConcrete during type binding of PCollections and DoFn signatures.","triggerScenarios":"Binding a type containing unsafe.Pointer or uintptr fields (exported, recursively); passing a nil or zero-value reflect.Type into typex.New/CheckConcrete (Kind Invalid).","commonSituations":"Structs wrapping unsafe pointers to interop with C or optimize memory; map/slice element types that resolve to invalid when built with reflection at runtime; generated code holding uintptr handles.","solutions":["Remove exported unsafe.Pointer/uintptr fields; store them unexported or convert to byte slices / fixed-size integer handles.","Check for nil reflect.Type before calling typex.New or CheckConcrete.","Replace unsafe interop patterns with encoding-safe representations (e.g. []byte, string, or uint64 IDs).","Run typex.CheckConcrete(type) in a unit test to pinpoint which nested field violates manageability."],"exampleFix":"// before\ntype Event struct {\n    Handle unsafe.Pointer\n}\n\n// after\ntype Event struct {\n    HandleID uint64\n}","handlingStrategy":"validation","validationCode":"func checkManageable(t reflect.Type) error {\n    switch t.Kind() {\n    case reflect.Invalid, reflect.UnsafePointer, reflect.Uintptr:\n        return fmt.Errorf(\"unmanageable kind %v in %v\", t.Kind(), t)\n    }\n    return nil\n}","typeGuard":"func hasUnsafeKinds(t reflect.Type) bool {\n    switch t.Kind() {\n    case reflect.Invalid, reflect.UnsafePointer, reflect.Uintptr:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Keep unsafe.Pointer/uintptr out of exported fields of element structs.","Check for nil reflect.Type before typex.New/CheckConcrete.","Prefer byte slices or numeric handles over raw pointer interop in data records."],"tags":["go","apache-beam","type-system","serialization"],"backgroundTag":"unsupported-dtype","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}