Commit 6c021c6
authored
doc: make TypeTest example compiling (#23009)
Current example is not compiling:
```scala
import scala.reflect.{ClassTag, TypeTest}
val tt: TypeTest[Any, String] =
new TypeTest[Any, String]:
def unapply(s: Any): Option[s.type & String] = s match
case s: String => Some(s) // compiler error Found: (s : String) Required: (s² : Any) & String
case _ => None
```
https://scastie.scala-lang.org/road21/jq3j9XsUTdeshqbHxDXv3w1 parent 99d640c commit 6c021c6
File tree
2 files changed
+2
-2
lines changed- docs
- _docs/reference/other-new-features
- _spec/TODOreference/other-new-features
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
0 commit comments