Skip to content

Commit 0cbe42b

Browse files
Merge pull request #12992 from dotty-staging/fix-typo-typetest
fix some typo in TypeTest doc
2 parents 9f97b0b + 4898a74 commit 0cbe42b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

library/src/scala/reflect/TypeTest.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
package 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}]")
1313
trait 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.

0 commit comments

Comments
 (0)