diff --git a/library/src/scala/quoted/Expr.scala b/library/src/scala/quoted/Expr.scala index acc9581b210a..24e9de48152c 100644 --- a/library/src/scala/quoted/Expr.scala +++ b/library/src/scala/quoted/Expr.scala @@ -69,7 +69,7 @@ object Expr { * to an expression equivalent to * `'{ List($e1, $e2, ...) }` typed as an `Expr[List[T]]` */ - def ofList[T](xs: Seq[Expr[T]])(using Type[T])(using Quotes): Expr[List[T]] = + def ofList[T](xs: Seq[Expr[T]])(using Type[T])(using Quotes): Expr[List[T]] = if (xs.isEmpty) Expr(Nil) else '{ List(${Varargs(xs)}: _*) } /** Creates an expression that will construct a copy of this tuple diff --git a/library/src/scala/quoted/Quotes.scala b/library/src/scala/quoted/Quotes.scala index 96424a176b35..9c69d731061e 100644 --- a/library/src/scala/quoted/Quotes.scala +++ b/library/src/scala/quoted/Quotes.scala @@ -939,7 +939,9 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => end extension end NamedArgMethods - /** Tree an application of arguments. It represents a single list of arguments, multiple argument lists will have nested `Apply`s */ + /** Tree representing an application of arguments. + * It represents a single list of arguments, multiple argument lists will have nested `Apply`s + */ type Apply <: Term /** `TypeTest` that allows testing at runtime in a pattern match if a `Tree` is an `Apply` */ @@ -968,7 +970,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => extension (self: Apply) /** The `fun` part of an (implicit) application like `fun(args)` * - * It maybe a partially applied method: + * It may be a partially applied method: * ```scala * def f(x1: Int)(x2: Int) = ... * f(1)(2) @@ -980,7 +982,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => def fun: Term /** The arguments (implicitly) passed to the method * - * The `Apply` maybe a partially applied method: + * The `Apply` may be a partially applied method: * ```scala * def f(x1: Int)(x2: Int) = ... * f(1)(2) @@ -993,7 +995,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => end extension end ApplyMethods - /** Tree an application of type arguments */ + /** Tree representing an application of type arguments */ type TypeApply <: Term /** `TypeTest` that allows testing at runtime in a pattern match if a `Tree` is a `TypeApply` */ @@ -1022,7 +1024,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => extension (self: TypeApply) /** The `fun` part of an (inferred) type application like `fun[Args]` * - * It maybe a partially applied method: + * It may be a partially applied method: * ```scala * extension (x: Int) def f[T](y: T) = ... * // represented as @@ -1038,7 +1040,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => def fun: Term /** The (inferred) type arguments passed to the method * - * The `TypeApply` maybe a partially applied method: + * The `TypeApply` may be a partially applied method: * ```scala * extension (x: Int) def f[T](y: T) = ... * // represented as @@ -1934,9 +1936,9 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => /** Type tree representing wildcard type bounds written in the source. * The wildcard type `_` (for example in in `List[_]`) will be a type tree that - * represents a type but has `TypeBound`a inside. + * represents a type but has `TypeBounds` inside. */ - type WildcardTypeTree <: Tree + type WildcardTypeTree <: Tree /** `TypeTest` that allows testing at runtime in a pattern match if a `Tree` is a `WildcardTypeTree` */ given WildcardTypeTreeTypeTest: TypeTest[Tree, WildcardTypeTree] @@ -3341,7 +3343,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => ///////////// /** Symbol of a definition. - * Then can be compared with == to know if the definition is the same. + * Symbols can be compared with `==` to know if two definitions are the same. */ type Symbol <: AnyRef @@ -4097,7 +4099,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => // REPORTING // /////////////// - /** Module containing error and waring reporting. */ + /** Module containing error and warning reporting. */ val report: reportModule /** Methods of the module object `val report` */ diff --git a/library/src/scala/quoted/Type.scala b/library/src/scala/quoted/Type.scala index 9077a626fc66..dcef5eb82b5f 100644 --- a/library/src/scala/quoted/Type.scala +++ b/library/src/scala/quoted/Type.scala @@ -4,7 +4,7 @@ import scala.annotation.compileTimeOnly /** Type (or type constructor) `T` needed contextually when using `T` in a quoted expression `'{... T ...}` */ abstract class Type[T <: AnyKind] private[scala]: - /** The type represented `Type` */ + /** The type represented by `Type` */ type Underlying = T end Type @@ -21,7 +21,9 @@ object Type: given of[T <: AnyKind](using Quotes): Type[T] = ??? - /** Extracts the value of singleton constant type, None otherwise. + /** Extracts the value of a singleton constant type. + * Returns Some of the value of the type if it is a singleton constant type. + * Returns None if the type is not a singleton constant type. * * Example usage: * ```scala