MCPcopy Create free account
hub / github.com/brimdata/super / TypeLength

Function TypeLength

runtime/sam/expr/function/len.go:44–66  ·  view source on GitHub ↗
(typ super.Type)

Source from the content-addressed store, hash-verified

42}
43
44func TypeLength(typ super.Type) int {
45 switch typ := typ.(type) {
46 case *super.TypeNamed:
47 return TypeLength(typ.Type)
48 case *super.TypeRecord:
49 return len(typ.Fields)
50 case *super.TypeUnion:
51 return len(typ.Types)
52 case *super.TypeSet:
53 return TypeLength(typ.Type)
54 case *super.TypeArray:
55 return TypeLength(typ.Type)
56 case *super.TypeEnum:
57 return len(typ.Symbols)
58 case *super.TypeMap:
59 return TypeLength(typ.ValType)
60 case *super.TypeError:
61 return TypeLength(typ.Type)
62 default:
63 // Primitive type
64 return 1
65 }
66}

Callers 2

CallMethod · 0.92
CallMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected