(elementInfos []TupleElementInfo, readonly bool)
| 24657 | } |
| 24658 | |
| 24659 | func (c *Checker) getTupleTargetType(elementInfos []TupleElementInfo, readonly bool) *Type { |
| 24660 | if len(elementInfos) == 1 && elementInfos[0].flags&ElementFlagsRest != 0 { |
| 24661 | // [...X[]] is equivalent to just X[] |
| 24662 | if readonly { |
| 24663 | return c.globalReadonlyArrayType |
| 24664 | } |
| 24665 | return c.globalArrayType |
| 24666 | } |
| 24667 | key := getTupleKey(elementInfos, readonly) |
| 24668 | t := c.tupleTypes[key] |
| 24669 | if t == nil { |
| 24670 | t = c.createTupleTargetType(elementInfos, readonly) |
| 24671 | c.tupleTypes[key] = t |
| 24672 | } |
| 24673 | return t |
| 24674 | } |
| 24675 | |
| 24676 | // We represent tuple types as type references to synthesized generic interface types created by |
| 24677 | // this function. The types are of the form: |
no test coverage detected