Overload Disambiguation
Overload disambiguation
For routine calls \"overload resolution\" is performed. There is a
weaker form of overload resolution called overload disambiguation that
is performed when an overloaded symbol is used in a context where there
is additional type information available. Let p
be an overloaded
symbol. These contexts are:
- In a function call
q(..., p, ...)
when the corresponding formal parameter ofq
is aproc
type. Ifq
itself is overloaded then the cartesian product of every interpretation ofq
andp
must be considered. - In an object constructor
Obj(..., field: p, ...)
whenfield
is aproc
type. Analogous rules exist for array/set/tuple constructors. - In a declaration like
x: T = p
whenT
is aproc
type.
As usual, ambiguous matches produce a compile-time error.