(vals []super.Value)
| 138 | } |
| 139 | |
| 140 | func (d *defuse) unifyType(vals []super.Value) super.Type { |
| 141 | seen := make(map[super.Type]struct{}) |
| 142 | var types []super.Type |
| 143 | for _, e := range vals { |
| 144 | typ := e.Type() |
| 145 | if _, ok := seen[typ]; !ok { |
| 146 | seen[typ] = struct{}{} |
| 147 | types = append(types, typ) |
| 148 | } |
| 149 | } |
| 150 | switch len(types) { |
| 151 | case 0: |
| 152 | return super.TypeNull // XXX should be TypeNone |
| 153 | case 1: |
| 154 | return types[0] |
| 155 | default: |
| 156 | return d.sctx.LookupTypeUnion(types) |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func (d *defuse) hasFusion(typ super.Type) bool { |
| 161 | if fused, ok := d.has[typ]; ok { |
no test coverage detected