Skip to content

Commit 0b4871d

Browse files
Merge pull request #8478 from dotty-staging/add-summon-docs
Add docs for DottyPredef.summon
2 parents fc4135d + 3ac1915 commit 0b4871d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/src/dotty/DottyPredef.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ object DottyPredef {
3737
case ev: ValueOf[T] => ev.value
3838
}
3939

40+
/** Summon a given value of type `T`. Usually, the argument is not passed explicitly.
41+
*
42+
* @tparam T the type of the value to be summoned
43+
* @return the given value typed as the provided type parameter
44+
*/
4045
inline def summon[T](using x: T): x.type = x
4146

4247
// Extension methods for working with explicit nulls

0 commit comments

Comments
 (0)