Skip to content

Add/update some docs in scala.quoted #10669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion library/src-bootstrapped/scala/quoted/Expr.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package scala.quoted

/** Quoted expression of type `T` */
/** Quoted expression of type `T`.
*
* `Expr` has extension methods that are defined in `scala.quoted.Quotes`.
*/
abstract class Expr[+T] private[scala]

/** Constructors for expressions */
object Expr {

/** `e.betaReduce` returns an expression that is functionally equivalent to `e`,
Expand Down
1 change: 1 addition & 0 deletions library/src-bootstrapped/scala/quoted/FromExpr.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trait FromExpr[T] {

}

/** Default given instances of `FromExpr` */
object FromExpr {

/** Default implementation of `FromExpr[Boolean]`
Expand Down
1 change: 1 addition & 0 deletions library/src-bootstrapped/scala/quoted/ToExpr.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ trait ToExpr[T] {

}

/** Default given instances of `ToExpr` */
object ToExpr {

// IMPORTANT Keep in sync with tests/run-staging/liftables.scala
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import scala.reflect.TypeTest
/** Current Quotes in scope */
inline def quotes(using q: Quotes): q.type = q

/** Quotation context provided by a macro expansion or in the scope of `scala.quoted.run`.
/** Quotation context provided by a macro expansion or in the scope of `scala.quoted.staging.run`.
* Used to perform all operations on quoted `Expr` or `Type`.
*
* It contains the low-level Typed AST API metaprogramming API.
Expand Down
4 changes: 2 additions & 2 deletions library/src/scala/quoted/Type.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package scala.quoted

import scala.annotation.compileTimeOnly

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

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

/** Show a source code like representation of this type without syntax highlight */
Expand Down
6 changes: 5 additions & 1 deletion library/src/scala/quoted/Varargs.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package scala.quoted

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

/** Lifts this sequence of expressions into an expression of a sequence
Expand Down