Skip to content

Commit 4d7f404

Browse files
committed
improved resolveOverloaded docs
fixed few mistakes, easier explanation of prefix type, more regular argument descriptions
1 parent 06f61e1 commit 4d7f404

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/reflect/scala/reflect/api/Symbols.scala

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -232,23 +232,23 @@ trait Symbols extends base.Symbols { self: Universe =>
232232
/** The overloaded alternatives of this symbol */
233233
def alternatives: List[Symbol]
234234

235-
/** Resolves an overloaded TermSymbol to a single non-overloaded TermSymbol that accepts
236-
* the specified argument types.
237-
* @param pre The prefix type. By passing a prefix type, type-level type parameters
238-
* can be converted within the member's type. Any example of a prefix would be
239-
* `List[Int]`, which would replace references to the type parameter `A` with the type
240-
* `Int`.
241-
* @param targs Only alternatives that can accept these type arguments will be considered. In all
242-
* alternatives that can accept these type arguments, they will be considered with these
243-
* substituted for their corresponding type parameters.
244-
* @param posVargs A sequence of the positional (normal) type arguments that a candidate alternative must
245-
* accept.
246-
* @param nameVargs A sequence of the named-parameter type arguments that a candidate alternative must
247-
* accept. Each element in the sequence should be a pair of a parameter name and an
248-
* argument type
249-
* @param expected A candidate member must have a return type compatible with this type.
250-
* @return Either a single, non-overloaded, Symbol referring the selected member or NoSymbol no single
251-
* member could be selected given the passed arguments.
235+
/** Performs method overloading resolution. More precisely, resolves an overloaded TermSymbol
236+
* to a single, non-overloaded TermSymbol that accepts the specified argument types.
237+
* @param pre The prefix type, i.e. the type of the value the method is dispatched on.
238+
* This is required when resolving references to type parameters of the type
239+
* the method is declared in. For example if the method is declared in class `List[A]`,
240+
* providing the prefix as `List[Int]` allows the overloading resolution to use
241+
* `Int` instead of `A`.
242+
* @param targs Type arguments that a candidate alternative must be able to accept. Candidates
243+
* will be considered with these arguments substituted for their corresponding
244+
* type parameters.
245+
* @param posVargs Positional argument types that a candidate alternative must be able to accept.
246+
* @param nameVargs Named argument types that a candidate alternative must be able to accept.
247+
* Each element in the sequence should be a pair of a parameter name and an
248+
* argument type.
249+
* @param expected Return type that a candidate alternative has to be compatible with.
250+
* @return Either a single, non-overloaded Symbol referring to the selected alternative
251+
* or NoSymbol if no single member could be selected given the passed arguments.
252252
*/
253253
def resolveOverloaded(
254254
pre: Type = NoPrefix,

0 commit comments

Comments
 (0)