(args ...vector.Any)
| 16 | } |
| 17 | |
| 18 | func (u *Under) Call(args ...vector.Any) vector.Any { |
| 19 | vec := args[0] |
| 20 | var index []uint32 |
| 21 | if view, ok := vec.(*vector.View); ok { |
| 22 | vec, index = view.Any, view.Index |
| 23 | } |
| 24 | var out vector.Any |
| 25 | switch vec := vec.(type) { |
| 26 | case *vector.Const: |
| 27 | val := vector.ValueAt(nil, vec, 0) |
| 28 | val = u.samunder.Call([]super.Value{val}) |
| 29 | out = vector.NewConstFromValue(val, vec.Len()) |
| 30 | case *vector.Named: |
| 31 | out = vec.Any |
| 32 | case *vector.Error: |
| 33 | out = vec.Vals |
| 34 | case *vector.Union: |
| 35 | return vec.Dynamic |
| 36 | case *vector.TypeValue: |
| 37 | typs := vector.NewTypeValueEmpty(0) |
| 38 | for i := range vec.Len() { |
| 39 | t, err := u.sctx.LookupByValue(vec.Value(i)) |
| 40 | if err != nil { |
| 41 | panic(err) |
| 42 | } |
| 43 | v := u.sctx.LookupTypeValue(super.TypeUnder(t)) |
| 44 | typs.Append(v.Bytes()) |
| 45 | } |
| 46 | out = typs |
| 47 | default: |
| 48 | return args[0] |
| 49 | } |
| 50 | if index != nil { |
| 51 | return vector.Pick(out, index) |
| 52 | } |
| 53 | return out |
| 54 | } |
nothing calls this directly
no test coverage detected