| 629 | } |
| 630 | |
| 631 | func pickRec(typ super.Type) ([]super.Type, int) { |
| 632 | switch typ := super.TypeUnder(typ).(type) { |
| 633 | case *super.TypeRecord: |
| 634 | return []super.Type{typ}, 0 |
| 635 | case *super.TypeUnion: |
| 636 | types := slices.Clone(typ.Types) |
| 637 | for k := range types { |
| 638 | if _, ok := super.TypeUnder(types[k]).(*super.TypeRecord); ok { |
| 639 | return types, k |
| 640 | } |
| 641 | } |
| 642 | } |
| 643 | return nil, 0 |
| 644 | } |
| 645 | |
| 646 | func (c *checker) putPaths(typ super.Type, puts []pathType) super.Type { |
| 647 | // Fuse each path as a single-record path into the input type. |