Skip to content

Commit 68ea63c

Browse files
committed
Document UnusedFunctionN and UnusedImplicitFunctionN
1 parent 5e774d7 commit 68ea63c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Definitions {
8888
newClassSymbol(ScalaPackageClass, name, EmptyFlags, completer).entered
8989
}
9090

91-
/** The trait FunctionN or ImplicitFunctionN, for some N
91+
/** The trait FunctionN, ImplicitFunctionN, UnusedFunctionN or UnusedImplicitFunction, for some N
9292
* @param name The name of the trait to be created
9393
*
9494
* FunctionN traits follow this template:
@@ -106,6 +106,20 @@ class Definitions {
106106
* trait ImplicitFunctionN[T0,...,T{N-1}, R] extends Object with FunctionN[T0,...,T{N-1}, R] {
107107
* def apply(implicit $x0: T0, ..., $x{N_1}: T{N-1}): R
108108
* }
109+
*
110+
* UnusedFunctionN traits follow this template:
111+
*
112+
* trait UnusedFunctionN[T0,...,T{N-1}, R] extends Object {
113+
* def apply(unused $x0: T0, ..., $x{N_1}: T{N-1}): R
114+
* }
115+
*
116+
* UnusedImplicitFunctionN traits follow this template:
117+
*
118+
* trait UnusedImplicitFunctionN[T0,...,T{N-1}, R] extends Object with UnusedFunctionN[T0,...,T{N-1}, R] {
119+
* def apply(unused implicit $x0: T0, ..., $x{N_1}: T{N-1}): R
120+
* }
121+
*
122+
* UnusedFunctionN and UnusedImplicitFunctionN erase to Function0.
109123
*/
110124
def newFunctionNTrait(name: TypeName): ClassSymbol = {
111125
val completer = new LazyType {

0 commit comments

Comments
 (0)