SignatureOverlaps indicates whether two functions have non-equal, but overloapping function signatures. For example, list(dyn) collides with list(string) since the 'dyn' type can contain a 'string' type.
(other *OverloadDecl)
| 735 | // |
| 736 | // For example, list(dyn) collides with list(string) since the 'dyn' type can contain a 'string' type. |
| 737 | func (o *OverloadDecl) SignatureOverlaps(other *OverloadDecl) bool { |
| 738 | if o.IsMemberFunction() != other.IsMemberFunction() || len(o.ArgTypes()) != len(other.ArgTypes()) { |
| 739 | return false |
| 740 | } |
| 741 | argsOverlap := true |
| 742 | for i, argType := range o.ArgTypes() { |
| 743 | otherArgType := other.ArgTypes()[i] |
| 744 | argsOverlap = argsOverlap && |
| 745 | (argType.IsAssignableType(otherArgType) || |
| 746 | otherArgType.IsAssignableType(argType)) |
| 747 | } |
| 748 | return argsOverlap |
| 749 | } |
| 750 | |
| 751 | // HasBinding indicates whether the overload already has a definition. |
| 752 | func (o *OverloadDecl) HasBinding() bool { |
no test coverage detected