File tree 1 file changed +5
-4
lines changed
library/src/scala/reflect
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
package scala .reflect
2
2
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
4
4
* type `S` is an instance of `T`.
5
5
*
6
6
* 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 :
8
8
* - `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`
10
10
* then a given instance of `TypeTest[S, T]` is summoned and used to perform the test.
11
11
*/
12
12
@ scala.annotation.implicitNotFound(msg = " No TypeTest available for [${S}, ${T}]" )
13
13
trait TypeTest [- S , T ] extends Serializable :
14
14
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`.
16
17
*
17
18
* The compiler tries to turn unchecked type tests in pattern matches into checked ones
18
19
* 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