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

Method hasError

runtime/sam/expr/function/types.go:95–125  ·  view source on GitHub ↗
(t super.Type, b scode.Bytes)

Source from the content-addressed store, hash-verified

93}
94
95func (h HasError) hasError(t super.Type, b scode.Bytes) bool {
96 switch typ := super.TypeUnder(t).(type) {
97 case *super.TypeRecord:
98 it := scode.NewRecordIter(b, typ.Opts)
99 return slices.ContainsFunc(typ.Fields, func(f super.Field) bool {
100 elem, none := it.Next(f.Opt)
101 return !none && h.hasError(f.Type, elem)
102 })
103 case *super.TypeArray, *super.TypeSet:
104 inner := super.InnerType(typ)
105 for it := b.Iter(); !it.Done(); {
106 if h.hasError(inner, it.Next()) {
107 return true
108 }
109 }
110 return false
111 case *super.TypeMap:
112 for it := b.Iter(); !it.Done(); {
113 if h.hasError(typ.KeyType, it.Next()) || h.hasError(typ.ValType, it.Next()) {
114 return true
115 }
116 }
117 return false
118 case *super.TypeUnion:
119 return h.hasError(typ.Untag(b))
120 case *super.TypeError:
121 return true
122 default:
123 return false
124 }
125}
126
127type Quiet struct {
128 sctx *super.Context

Callers 1

CallMethod · 0.95

Calls 7

NextMethod · 0.95
DoneMethod · 0.95
TypeUnderFunction · 0.92
NewRecordIterFunction · 0.92
InnerTypeFunction · 0.92
IterMethod · 0.80
UntagMethod · 0.80

Tested by

no test coverage detected