Skip to content

Commit 87bb3f9

Browse files
authored
Merge pull request #387 from scala/backport-lts-3.3-23009
Backport "doc: make TypeTest example compiling" to 3.3 LTS
2 parents bd50194 + e983911 commit 87bb3f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/_docs/reference/other-new-features/type-test.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ We could create a type test at call site where the type test can be performed wi
6363
val tt: TypeTest[Any, String] =
6464
new TypeTest[Any, String]:
6565
def unapply(s: Any): Option[s.type & String] = s match
66-
case s: String => Some(s)
66+
case q: (s.type & String) => Some(q)
6767
case _ => None
6868

6969
f[AnyRef, String]("acb")(using tt)

docs/_spec/TODOreference/other-new-features/type-test.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ We could create a type test at call site where the type test can be performed wi
6363
val tt: TypeTest[Any, String] =
6464
new TypeTest[Any, String]:
6565
def unapply(s: Any): Option[s.type & String] = s match
66-
case s: String => Some(s)
66+
case q: (s.type & String) => Some(q)
6767
case _ => None
6868

6969
f[AnyRef, String]("acb")(using tt)

0 commit comments

Comments
 (0)