Aliasing this in scala with self =>
问题 Some Scala APIs alias this to self , for example, trait Function1[-T1, +R] extends AnyRef { self => I know how this aliasing works in general, but don't see how traits such as Function1 benefit from it. Function1 does not use self anywhere in its definition except for the initial mention, so what is its purpose here? Variants of this question have been asked previously, but the answers are not directly applicable. Answers have discussed self types and inner classes, but I don't see how that