Many standard library functions (e.g. range) have polymorphic types that must be expressed in terms of multiple signatures given with typing.overload. If we want to be able to create and work with Operations that faithfully mirror these functions, we may need to support overload in our type inference machinery.
The official specification for overload describes how to type applications of overloaded functions, and the Callable specification describes how to unify overloaded functions with other function types. It might be possible to represent such types internally with Union and share the existing Union code paths, which would greatly simplify the implementation if doing so really is correct under the specification.
Many standard library functions (e.g.
range) have polymorphic types that must be expressed in terms of multiple signatures given withtyping.overload. If we want to be able to create and work withOperations that faithfully mirror these functions, we may need to supportoverloadin our type inference machinery.The official specification for
overloaddescribes how to type applications ofoverloaded functions, and theCallablespecification describes how to unifyoverloaded functions with other function types. It might be possible to represent such types internally withUnionand share the existingUnioncode paths, which would greatly simplify the implementation if doing so really is correct under the specification.