File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
library/src/scala/reflect Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11package scala .reflect
22
3- /** A `TypeTest[S, T] contains the logic needed to know at runtime if a value of
3+ /** A `TypeTest[S, T]` contains the logic needed to know at runtime if a value of
44 * type `S` is an instance of `T`.
55 *
66 * If a pattern match is performed on a term of type `s: S` that is uncheckable with `s.isInstanceOf[T]` and
7- * the pattern are of the form :
7+ * the pattern is one of the following forms :
88 * - `t: T`
9- * - `t @ X()` where the `X.unapply` has takes an argument of type `T`
9+ * - `t @ X()` where `X.unapply` takes an argument of type `T`
1010 * then a given instance of `TypeTest[S, T]` is summoned and used to perform the test.
1111 */
1212@ scala.annotation.implicitNotFound(msg = " No TypeTest available for [${S}, ${T}]" )
1313trait TypeTest [- S , T ] extends Serializable :
1414
15- /** A TypeTest[S, T] can serve as an extractor that matches if and only if S of type T.
15+ /** A `TypeTest[S, T]` can serve as an extractor that matches if and only if a value of type `S` is
16+ * an instance of `T`.
1617 *
1718 * The compiler tries to turn unchecked type tests in pattern matches into checked ones
1819 * by wrapping a `(_: T)` type pattern as `tt(_: T)`, where `tt` is the `TypeTest[S, T]` instance.
You can’t perform that action at this time.
0 commit comments