From 7dbf29ebb278331004a774cba5d8988add35f4e9 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 9 Mar 2020 09:37:55 +0100 Subject: [PATCH 1/2] Add docs for DottyPredef.summon --- library/src/dotty/DottyPredef.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/src/dotty/DottyPredef.scala b/library/src/dotty/DottyPredef.scala index 7936a054c675..86e7bb8a3b47 100644 --- a/library/src/dotty/DottyPredef.scala +++ b/library/src/dotty/DottyPredef.scala @@ -37,6 +37,11 @@ object DottyPredef { case ev: ValueOf[T] => ev.value } + /** Summon an given value of type `T`. Usually, the argument is not passed explicitly. + * + * @tparam T the type of the value to be summoned + * @return the given value typed as the given parameter + */ inline def summon[T](using x: T): x.type = x // Extension methods for working with explicit nulls From 3ac191537bd71452bc385ad41856a86c843264e1 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 9 Mar 2020 11:22:02 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-Authored-By: Anatolii Kmetiuk --- library/src/dotty/DottyPredef.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/dotty/DottyPredef.scala b/library/src/dotty/DottyPredef.scala index 86e7bb8a3b47..c368c6f5b4a2 100644 --- a/library/src/dotty/DottyPredef.scala +++ b/library/src/dotty/DottyPredef.scala @@ -37,10 +37,10 @@ object DottyPredef { case ev: ValueOf[T] => ev.value } - /** Summon an given value of type `T`. Usually, the argument is not passed explicitly. + /** Summon a given value of type `T`. Usually, the argument is not passed explicitly. * * @tparam T the type of the value to be summoned - * @return the given value typed as the given parameter + * @return the given value typed as the provided type parameter */ inline def summon[T](using x: T): x.type = x