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

Method unifyType

runtime/sam/expr/function/unblend.go:120–138  ·  view source on GitHub ↗
(vals []super.Value)

Source from the content-addressed store, hash-verified

118}
119
120func (u *unblend) unifyType(vals []super.Value) super.Type {
121 seen := make(map[super.Type]struct{})
122 var types []super.Type
123 for _, e := range vals {
124 typ := e.Type()
125 if _, ok := seen[typ]; !ok {
126 seen[typ] = struct{}{}
127 types = append(types, typ)
128 }
129 }
130 switch len(types) {
131 case 0:
132 return super.TypeNull // XXX should be TypeNone
133 case 1:
134 return types[0]
135 default:
136 return u.sctx.LookupTypeUnion(types)
137 }
138}

Callers 1

evalMethod · 0.95

Calls 2

LookupTypeUnionMethod · 0.80
TypeMethod · 0.65

Tested by

no test coverage detected