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

Function pickRec

compiler/semantic/checker.go:631–644  ·  view source on GitHub ↗
(typ super.Type)

Source from the content-addressed store, hash-verified

629}
630
631func pickRec(typ super.Type) ([]super.Type, int) {
632 switch typ := super.TypeUnder(typ).(type) {
633 case *super.TypeRecord:
634 return []super.Type{typ}, 0
635 case *super.TypeUnion:
636 types := slices.Clone(typ.Types)
637 for k := range types {
638 if _, ok := super.TypeUnder(types[k]).(*super.TypeRecord); ok {
639 return types, k
640 }
641 }
642 }
643 return nil, 0
644}
645
646func (c *checker) putPaths(typ super.Type, puts []pathType) super.Type {
647 // Fuse each path as a single-record path into the input type.

Callers 1

dropPathMethod · 0.85

Calls 2

TypeUnderFunction · 0.92
CloneMethod · 0.65

Tested by

no test coverage detected