Skip to content

Commit 9835d33

Browse files
committed
Describe type parameter interpolation in @implicitNotFound documentation
Using this feature is necessary for helpful error messages, so it should be documented. Thank you to @adriaanm for recommending the this description.
1 parent 33be64d commit 9835d33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/library/scala/annotation/implicitNotFound.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
package scala.annotation
1010

1111
/**
12-
* An annotation that specifies the error message that is emitted when the compiler
13-
* cannot find an implicit value of the annotated type.
12+
* To customize the error message that's emitted when an implicit of type
13+
* C[T1,..., TN] cannot be found, annotate the class C with @implicitNotFound.
14+
* Assuming C has type parameters X1,..., XN, the error message will be the
15+
* result of replacing all occurrences of ${Xi} in the string msg with the
16+
* string representation of the corresponding type argument Ti. *
1417
*
1518
* @author Adriaan Moors
1619
* @since 2.8.1

0 commit comments

Comments
 (0)