diff --git a/cmd/libs/go2idl/deepcopy-gen/generators/deepcopy.go b/cmd/libs/go2idl/deepcopy-gen/generators/deepcopy.go index faf4fa63722..edaf75627b3 100644 --- a/cmd/libs/go2idl/deepcopy-gen/generators/deepcopy.go +++ b/cmd/libs/go2idl/deepcopy-gen/generators/deepcopy.go @@ -118,10 +118,12 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat // avoid having to make a reflection call. canInlineTypeFn := func(c *generator.Context, t *types.Type) bool { // types must be public structs or have a custom DeepCopy_ already defined - if !copyableWithinPackage(t, explicitInputs.Has(t.Name.Package)) && !publicCopyFunctionDefined(c, t) { + if publicCopyFunctionDefined(c, t) { + return true + } + if !copyableWithinPackage(t, explicitInputs.Has(t.Name.Package)) { return false } - // only packages within the restricted range can be inlined for _, s := range restrictRange { if strings.HasPrefix(t.Name.Package, s) {