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

Method addArrayType

bind/symbols.go:904–931  ·  view source on GitHub ↗
(pkg *types.Package, obj types.Object, t types.Type, kind symkind, id, n string)

Source from the content-addressed store, hash-verified

902}
903
904func (sym *symtab) addArrayType(pkg *types.Package, obj types.Object, t types.Type, kind symkind, id, n string) error {
905 fn := sym.fullTypeString(t)
906 typ := t.Underlying().(*types.Array)
907 kind |= skArray
908 elt := typ.Elem()
909 elsym, err := sym.addTypeIfNew(elt)
910 if err != nil {
911 return err
912 }
913 if elsym.isSignature() {
914 return fmt.Errorf("gopy: array value type cannot be signature / func: %q", elsym.goname)
915 }
916 sym.syms[fn] = &symbol{
917 gopkg: pkg,
918 goobj: obj,
919 gotyp: t,
920 kind: kind,
921 id: id,
922 goname: n,
923 cgoname: "CGoHandle", // handles
924 cpyname: PyHandle,
925 pysig: "[]" + elsym.pysig,
926 go2py: "handleFromPtr_" + id,
927 py2go: "deptrFromHandle_" + id,
928 zval: "nil",
929 }
930 return nil
931}
932
933func (sym *symtab) addMapType(pkg *types.Package, obj types.Object, t types.Type, kind symkind, id, n string) error {
934 fn := sym.fullTypeString(t)

Callers 1

addTypeMethod · 0.95

Calls 3

fullTypeStringMethod · 0.95
addTypeIfNewMethod · 0.95
isSignatureMethod · 0.80

Tested by

no test coverage detected