Skip to content

Commit 007dacd

Browse files
authored
Merge pull request scala#12243 from MaximeKjaer/fix-quoted-scaladoc-typos
Minor fixes to `scala.quoted` docs
2 parents 01eb5a2 + 15f21c2 commit 007dacd

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

library/src/scala/quoted/Expr.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ object Expr {
6969
* to an expression equivalent to
7070
* `'{ List($e1, $e2, ...) }` typed as an `Expr[List[T]]`
7171
*/
72-
def ofList[T](xs: Seq[Expr[T]])(using Type[T])(using Quotes): Expr[List[T]] =
72+
def ofList[T](xs: Seq[Expr[T]])(using Type[T])(using Quotes): Expr[List[T]] =
7373
if (xs.isEmpty) Expr(Nil) else '{ List(${Varargs(xs)}: _*) }
7474

7575
/** Creates an expression that will construct a copy of this tuple

library/src/scala/quoted/Quotes.scala

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,9 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
939939
end extension
940940
end NamedArgMethods
941941

942-
/** Tree an application of arguments. It represents a single list of arguments, multiple argument lists will have nested `Apply`s */
942+
/** Tree representing an application of arguments.
943+
* It represents a single list of arguments, multiple argument lists will have nested `Apply`s
944+
*/
943945
type Apply <: Term
944946

945947
/** `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 =>
968970
extension (self: Apply)
969971
/** The `fun` part of an (implicit) application like `fun(args)`
970972
*
971-
* It maybe a partially applied method:
973+
* It may be a partially applied method:
972974
* ```scala
973975
* def f(x1: Int)(x2: Int) = ...
974976
* f(1)(2)
@@ -980,7 +982,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
980982
def fun: Term
981983
/** The arguments (implicitly) passed to the method
982984
*
983-
* The `Apply` maybe a partially applied method:
985+
* The `Apply` may be a partially applied method:
984986
* ```scala
985987
* def f(x1: Int)(x2: Int) = ...
986988
* f(1)(2)
@@ -993,7 +995,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
993995
end extension
994996
end ApplyMethods
995997

996-
/** Tree an application of type arguments */
998+
/** Tree representing an application of type arguments */
997999
type TypeApply <: Term
9981000

9991001
/** `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 =>
10221024
extension (self: TypeApply)
10231025
/** The `fun` part of an (inferred) type application like `fun[Args]`
10241026
*
1025-
* It maybe a partially applied method:
1027+
* It may be a partially applied method:
10261028
* ```scala
10271029
* extension (x: Int) def f[T](y: T) = ...
10281030
* // represented as
@@ -1038,7 +1040,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
10381040
def fun: Term
10391041
/** The (inferred) type arguments passed to the method
10401042
*
1041-
* The `TypeApply` maybe a partially applied method:
1043+
* The `TypeApply` may be a partially applied method:
10421044
* ```scala
10431045
* extension (x: Int) def f[T](y: T) = ...
10441046
* // represented as
@@ -1934,9 +1936,9 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
19341936

19351937
/** Type tree representing wildcard type bounds written in the source.
19361938
* The wildcard type `_` (for example in in `List[_]`) will be a type tree that
1937-
* represents a type but has `TypeBound`a inside.
1939+
* represents a type but has `TypeBounds` inside.
19381940
*/
1939-
type WildcardTypeTree <: Tree
1941+
type WildcardTypeTree <: Tree
19401942

19411943
/** `TypeTest` that allows testing at runtime in a pattern match if a `Tree` is a `WildcardTypeTree` */
19421944
given WildcardTypeTreeTypeTest: TypeTest[Tree, WildcardTypeTree]
@@ -3341,7 +3343,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
33413343
/////////////
33423344

33433345
/** Symbol of a definition.
3344-
* Then can be compared with == to know if the definition is the same.
3346+
* Symbols can be compared with `==` to know if two definitions are the same.
33453347
*/
33463348
type Symbol <: AnyRef
33473349

@@ -4097,7 +4099,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
40974099
// REPORTING //
40984100
///////////////
40994101

4100-
/** Module containing error and waring reporting. */
4102+
/** Module containing error and warning reporting. */
41014103
val report: reportModule
41024104

41034105
/** Methods of the module object `val report` */

library/src/scala/quoted/Type.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.annotation.compileTimeOnly
44

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

@@ -21,7 +21,9 @@ object Type:
2121
given of[T <: AnyKind](using Quotes): Type[T] = ???
2222

2323

24-
/** Extracts the value of singleton constant type, None otherwise.
24+
/** Extracts the value of a singleton constant type.
25+
* Returns Some of the value of the type if it is a singleton constant type.
26+
* Returns None if the type is not a singleton constant type.
2527
*
2628
* Example usage:
2729
* ```scala

0 commit comments

Comments
 (0)