processTuple ensures that all types in a tuple are in sym table
(tuple *types.Tuple)
| 588 | |
| 589 | // processTuple ensures that all types in a tuple are in sym table |
| 590 | func (sym *symtab) processTuple(tuple *types.Tuple) error { |
| 591 | if tuple == nil { |
| 592 | return nil |
| 593 | } |
| 594 | for i := 0; i < tuple.Len(); i++ { |
| 595 | ivar := tuple.At(i) |
| 596 | ityp := ivar.Type() |
| 597 | isym := sym.symtype(ityp) |
| 598 | if isym != nil { |
| 599 | continue |
| 600 | } |
| 601 | err := sym.addType(ivar, ityp) |
| 602 | if err != nil { |
| 603 | return err |
| 604 | } |
| 605 | } |
| 606 | return nil |
| 607 | } |
| 608 | |
| 609 | // buildTuple returns a string of Go code that builds a PyTuple |
| 610 | // for the given tuple (e.g., function args). |