| 642 | } |
| 643 | |
| 644 | func newOverloadInternal(overloadID string, |
| 645 | memberFunction bool, args []*types.Type, resultType *types.Type, |
| 646 | opts ...OverloadOpt) (*OverloadDecl, error) { |
| 647 | overload := &OverloadDecl{ |
| 648 | id: overloadID, |
| 649 | argTypes: args, |
| 650 | resultType: resultType, |
| 651 | isMemberFunction: memberFunction, |
| 652 | } |
| 653 | var err error |
| 654 | for _, opt := range opts { |
| 655 | overload, err = opt(overload) |
| 656 | if err != nil { |
| 657 | return nil, err |
| 658 | } |
| 659 | } |
| 660 | return overload, nil |
| 661 | } |
| 662 | |
| 663 | // OverloadDecl contains the definition of a single overload id with a specific signature, and an optional |
| 664 | // implementation. |