Skip to content

Commit d199fd3

Browse files
Merge pull request #10669 from dotty-staging/add-some-docs
Add/update some docs in scala.quoted
2 parents 38116bf + b570b18 commit d199fd3

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

library/src-bootstrapped/scala/quoted/Expr.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
package scala.quoted
22

3-
/** Quoted expression of type `T` */
3+
/** Quoted expression of type `T`.
4+
*
5+
* `Expr` has extension methods that are defined in `scala.quoted.Quotes`.
6+
*/
47
abstract class Expr[+T] private[scala]
58

9+
/** Constructors for expressions */
610
object Expr {
711

812
/** `e.betaReduce` returns an expression that is functionally equivalent to `e`,

library/src-bootstrapped/scala/quoted/FromExpr.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ trait FromExpr[T] {
2121

2222
}
2323

24+
/** Default given instances of `FromExpr` */
2425
object FromExpr {
2526

2627
/** Default implementation of `FromExpr[Boolean]`

library/src-bootstrapped/scala/quoted/ToExpr.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ trait ToExpr[T] {
1212

1313
}
1414

15+
/** Default given instances of `ToExpr` */
1516
object ToExpr {
1617

1718
// IMPORTANT Keep in sync with tests/run-staging/liftables.scala

library/src/scala/quoted/Quotes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import scala.reflect.TypeTest
55
/** Current Quotes in scope */
66
inline def quotes(using q: Quotes): q.type = q
77

8-
/** Quotation context provided by a macro expansion or in the scope of `scala.quoted.run`.
8+
/** Quotation context provided by a macro expansion or in the scope of `scala.quoted.staging.run`.
99
* Used to perform all operations on quoted `Expr` or `Type`.
1010
*
1111
* It contains the low-level Typed AST API metaprogramming API.

library/src/scala/quoted/Type.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package scala.quoted
22

33
import scala.annotation.compileTimeOnly
44

5-
/** Quoted type (or kind) `T` */
5+
/** Type (or type constructor) `T` needed contextually when using `T` in a quoted expression `'{... T ...}` */
66
abstract class Type[T <: AnyKind] private[scala]:
77
/** The type represented `Type` */
88
type Underlying = T
99
end Type
1010

11-
/** Some basic type tags, currently incomplete */
11+
/** Methods to interact with the current `Type[T]` in scope */
1212
object Type:
1313

1414
/** Show a source code like representation of this type without syntax highlight */

library/src/scala/quoted/Varargs.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package scala.quoted
22

3-
/** Literal sequence of expressions */
3+
/** Expression reepresentation of literal sequence of expressions.
4+
*
5+
* `Varargs` can be used to create the an expression `args` that will be used as varargs `'{ f($args: _*) }`
6+
* or it can be used to extract all the arguments of the a varargs.
7+
*/
48
object Varargs {
59

610
/** Lifts this sequence of expressions into an expression of a sequence

0 commit comments

Comments
 (0)