@@ -68,7 +68,7 @@ val tt: TypeTest[Any, String] =
68
68
f[AnyRef , String ](" acb" )(using tt)
69
69
```
70
70
71
- The compiler will synthesize a new instance of a type test if non is found in scope as
71
+ The compiler will synthesize a new instance of a type test if none is found in scope as:
72
72
``` scala
73
73
new TypeTest [A , B ]:
74
74
def unapply (s : A ): Option [s.type & B ] =
@@ -78,8 +78,8 @@ new TypeTest[A, B]:
78
78
```
79
79
If the type tests cannot be done there will be an unchecked warning that will be raised on the ` case s: B => ` test.
80
80
81
- The most common ` TypeTest ` are the ones that take any parameters (i.e. ` TypeTest[Any, T] ` ).
82
- To make it possible to use this directly in context bounds we provide the alias
81
+ The most common ` TypeTest ` instances are the ones that take any parameters (i.e. ` TypeTest[Any, T] ` ).
82
+ To make it possible to use such instances directly in context bounds we provide the alias
83
83
``` scala
84
84
package scala .reflect
85
85
@@ -99,10 +99,10 @@ f[Int] // fasle
99
99
```
100
100
101
101
### TypeTest and ClassTag
102
- ` TypeTest ` is a replacemnt for the same functionallity performed by the ` ClassTag.unaplly ` .
103
- Using ` ClassTag ` instances happend to be unsound .
104
- ` TypeTest ` fixes that unsoundess and adds extra flexibility with the ` S ` type .
105
- ` ClassTag ` type tests will still be supported but a warining will be emitted after 3.0.
102
+ ` TypeTest ` is a replacement for functionality provided previously by ` ClassTag.unapply ` .
103
+ Using ` ClassTag ` instances was unsound since classtags can check only the class component of a type .
104
+ ` TypeTest ` fixes that unsoundness .
105
+ ` ClassTag ` type tests are still supported but a warning will be emitted after 3.0.
106
106
107
107
108
108
Examples
@@ -132,7 +132,7 @@ it will be possible to write the following program
132
132
133
133
``` scala
134
134
val peano : Peano = ...
135
- import peano .{ _ , given _ }
135
+ import peano ._
136
136
def divOpt (m : Nat , n : Nat ): Option [(Nat , Nat )] =
137
137
n match
138
138
case Zero => None
0 commit comments