(vals []super.Value)
| 118 | } |
| 119 | |
| 120 | func (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 | } |
no test coverage detected