MCPcopy Index your code
hub / github.com/go-python/gopy / needWrapType

Function needWrapType

bind/types.go:26–57  ·  view source on GitHub ↗
(typ types.Type)

Source from the content-addressed store, hash-verified

24}
25
26func needWrapType(typ types.Type) bool {
27 switch typ := typ.(type) {
28 case *types.Basic:
29 return false
30 case *types.Struct:
31 return true
32 case *types.Named:
33 switch ut := typ.Underlying().(type) {
34 case *types.Basic:
35 return false
36 default:
37 return needWrapType(ut)
38 }
39 case *types.Array:
40 return true
41 case *types.Map:
42 return true
43 case *types.Slice:
44 return true
45 case *types.Interface:
46 wrap := true
47 if typ.Underlying() == universe.syms["error"].GoType().Underlying() {
48 wrap = false
49 }
50 return wrap
51 case *types.Signature:
52 return true
53 case *types.Pointer:
54 return needWrapType(typ.Elem())
55 }
56 return false
57}
58
59///////////////////////////////////////////////////////////////////////////////////
60// Struct

Callers

nothing calls this directly

Calls 1

GoTypeMethod · 0.65

Tested by

no test coverage detected