From 8a826ecfff610932e9e8d459d950b8d716258a31 Mon Sep 17 00:00:00 2001 From: Aleksey Troitskiy Date: Wed, 16 Apr 2025 18:39:21 +0300 Subject: [PATCH] [doc]: make TypeTest example compiling --- docs/_docs/reference/other-new-features/type-test.md | 2 +- docs/_spec/TODOreference/other-new-features/type-test.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_docs/reference/other-new-features/type-test.md b/docs/_docs/reference/other-new-features/type-test.md index ec7a87230753..fb2a2e584711 100644 --- a/docs/_docs/reference/other-new-features/type-test.md +++ b/docs/_docs/reference/other-new-features/type-test.md @@ -63,7 +63,7 @@ We could create a type test at call site where the type test can be performed wi val tt: TypeTest[Any, String] = new TypeTest[Any, String]: def unapply(s: Any): Option[s.type & String] = s match - case s: String => Some(s) + case q: (s.type & String) => Some(q) case _ => None f[AnyRef, String]("acb")(using tt) diff --git a/docs/_spec/TODOreference/other-new-features/type-test.md b/docs/_spec/TODOreference/other-new-features/type-test.md index ec7a87230753..fb2a2e584711 100644 --- a/docs/_spec/TODOreference/other-new-features/type-test.md +++ b/docs/_spec/TODOreference/other-new-features/type-test.md @@ -63,7 +63,7 @@ We could create a type test at call site where the type test can be performed wi val tt: TypeTest[Any, String] = new TypeTest[Any, String]: def unapply(s: Any): Option[s.type & String] = s match - case s: String => Some(s) + case q: (s.type & String) => Some(q) case _ => None f[AnyRef, String]("acb")(using tt)