| 579 | } |
| 580 | |
| 581 | func newOverloadInternal(overloadID string, |
| 582 | memberFunction bool, args []*types.Type, resultType *types.Type, |
| 583 | opts ...OverloadOpt) (*OverloadDecl, error) { |
| 584 | overload := &OverloadDecl{ |
| 585 | id: overloadID, |
| 586 | argTypes: args, |
| 587 | resultType: resultType, |
| 588 | isMemberFunction: memberFunction, |
| 589 | } |
| 590 | var err error |
| 591 | for _, opt := range opts { |
| 592 | overload, err = opt(overload) |
| 593 | if err != nil { |
| 594 | return nil, err |
| 595 | } |
| 596 | } |
| 597 | return overload, nil |
| 598 | } |
| 599 | |
| 600 | // OverloadDecl contains the definition of a single overload id with a specific signature, and an optional |
| 601 | // implementation. |