(args []super.Value)
| 25 | } |
| 26 | |
| 27 | func (n *Flatten) Call(args []super.Value) super.Value { |
| 28 | val := args[0] |
| 29 | typ := super.TypeRecordOf(val.Type()) |
| 30 | if typ == nil { |
| 31 | return val |
| 32 | } |
| 33 | inner := n.innerTypeOf(typ, val.Bytes()) |
| 34 | n.Reset() |
| 35 | n.encode(typ, inner, field.Path{}, val.Bytes()) |
| 36 | return super.NewValue(n.sctx.LookupTypeArray(inner), n.Bytes()) |
| 37 | } |
| 38 | |
| 39 | func (n *Flatten) innerTypeOf(typ *super.TypeRecord, b scode.Bytes) super.Type { |
| 40 | n.types = n.appendTypes(n.types[:0], b, typ) |
nothing calls this directly
no test coverage detected