File tree 2 files changed +3
-3
lines changed
docs/docs/reference/other-new-features
library/src/scala/reflect
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ TypeTest
10
10
` TypeTest.unapply ` will return ` Some(x.asInstanceOf[Y]) ` if ` x ` conforms to ` Y ` , otherwise it returns ` None ` .
11
11
12
12
``` scala
13
- trait TypeTest [S , T <: S ] extends Serializable {
13
+ trait TypeTest [- S , T ] extends Serializable {
14
14
def unapply (s : S ): Option [s.type & T ]
15
15
}
16
16
```
Original file line number Diff line number Diff line change 1
1
package scala .reflect
2
2
3
- /** A `TypeTest[S, T]` (where `T <: S`) 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` can be downcased to `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
@@ -12,7 +12,7 @@ package scala.reflect
12
12
* Note: This is replacemet for `ClassTag.unapply` that can be sound for path dependent types
13
13
*/
14
14
@ scala.annotation.implicitNotFound(msg = " No TypeTest available for [${S}, ${T}]" )
15
- trait TypeTest [S , T <: S ] extends Serializable {
15
+ trait TypeTest [- S , T ] extends Serializable {
16
16
17
17
/** A TypeTest[S, T] can serve as an extractor that matches only S of type T.
18
18
*
You can’t perform that action at this time.
0 commit comments