Dotty Documentation


object ExtensionMethods
extends Object

[-] Constructors

[-] Members

[+] def extensionMethod ( imeth: Symbol ) ( implicit ctx: Context ) : TermSymbol

Return the extension method that corresponds to given instance method meth.

[+] private def extensionNames ( imeth: Symbol ) ( implicit ctx: Context ) : Stream [ Name ]

Generate stream of possible names for the extension version of given instance method imeth. If the method is not overloaded, this stream consists of just "imeth$extension". If the method is overloaded, the stream has as first element "imeth$extenionX", where X is the index of imeth in the sequence of overloaded alternatives with the same name. This choice will always be picked as the name of the generated extension method. After this first choice, all other possible indices in the range of 0 until the number of overloaded alternatives are returned. The secondary choices are used to find a matching method in extensionMethod if the first name has the wrong type. We thereby gain a level of insensitivity of how overloaded types are ordered between phases and picklings.