From c1184899c281fff6defc2993427b8f69ef9bfb39 Mon Sep 17 00:00:00 2001 From: "Lan, Jian" Date: Sat, 18 Jul 2020 15:07:44 -0700 Subject: [PATCH] Fix docs code examples for collective extensions --- docs/docs/reference/contextual/extension-methods.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/reference/contextual/extension-methods.md b/docs/docs/reference/contextual/extension-methods.md index 590eee5481fa..486e07995378 100644 --- a/docs/docs/reference/contextual/extension-methods.md +++ b/docs/docs/reference/contextual/extension-methods.md @@ -102,7 +102,7 @@ a single extension and enclose all methods in braces or an indented region follo Example: ```scala -extension (ss: Seq[String]) +extension (ss: Seq[String]): def longestStrings: Seq[String] = val maxLength = ss.map(_.length).max @@ -130,7 +130,7 @@ extension (ss: Seq[String]) Collective extensions also can take type parameters and have using clauses. Example ```scala -extension [T](xs: List[T])(using Ordering[T]) +extension [T](xs: List[T])(using Ordering[T]): def smallest(n: Int): List[T] = xs.sorted.take(n) def smallestIndices(n: Int): List[Int] = val limit = smallest(n).max