| 158 | } |
| 159 | |
| 160 | func (d *defuse) hasFusion(typ super.Type) bool { |
| 161 | if fused, ok := d.has[typ]; ok { |
| 162 | return fused |
| 163 | } |
| 164 | var has bool |
| 165 | switch typ := typ.(type) { |
| 166 | case *super.TypeRecord: |
| 167 | has = slices.ContainsFunc(typ.Fields, func(f super.Field) bool { return d.hasFusion(f.Type) }) |
| 168 | case *super.TypeArray: |
| 169 | has = d.hasFusion(typ.Type) |
| 170 | case *super.TypeSet: |
| 171 | has = d.hasFusion(typ.Type) |
| 172 | case *super.TypeMap: |
| 173 | has = d.hasFusion(typ.KeyType) || d.hasFusion(typ.ValType) |
| 174 | case *super.TypeError: |
| 175 | has = d.hasFusion(typ.Type) |
| 176 | case *super.TypeFusion: |
| 177 | has = true |
| 178 | } |
| 179 | d.has[typ] = has |
| 180 | return has |
| 181 | } |