Skip to content

Commit 11f53c7

Browse files
authored
Merge pull request #10590 from dotty-staging/improve-quoted-runtime-docs
Improve quoted.runtime docs
2 parents 97101fb + 6089488 commit 11f53c7

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

library/src/scala/quoted/runtime/Expr.scala

+12-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@ import scala.annotation.{Annotation, compileTimeOnly}
66
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Expr`")
77
object Expr:
88

9-
/** A term quote is desugared by the compiler into a call to this method */
9+
/** A term quote is desugared by the compiler into a call to this method
10+
*
11+
* Calling this method in source has undefined behaviour at compile-time
12+
*/
1013
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Expr.quote`")
1114
def quote[T](x: T): Quotes ?=> scala.quoted.Expr[T] = ???
1215

13-
/** A term splice is desugared by the compiler into a call to this method */
16+
/** A term splice is desugared by the compiler into a call to this method
17+
*
18+
* Calling this method in source has undefined behaviour at compile-time
19+
*/
1420
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Expr.splice`")
1521
def splice[T](x: Quotes ?=> scala.quoted.Expr[T]): T = ???
1622

1723
/** A term splice nested within a quote is desugared by the compiler into a call to this method.
18-
* `ctx` is the `Quotes` that the quote of this splice uses.
19-
*/
24+
* `ctx` is the `Quotes` that the quote of this splice uses.
25+
*
26+
* Calling this method in source has undefined behaviour at compile-time
27+
*/
2028
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Expr.nestedSplice`")
2129
def nestedSplice[T](q: Quotes)(x: q.Nested ?=> scala.quoted.Expr[T]): T = ???

library/src/scala/quoted/runtime/Patterns.scala

+20-5
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,38 @@ import scala.annotation.{Annotation, compileTimeOnly}
55
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Patterns`")
66
object Patterns {
77

8-
/** A splice in a quoted pattern is desugared by the compiler into a call to this method */
8+
/** A splice in a quoted pattern is desugared by the compiler into a call to this method.
9+
*
10+
* Calling this method in source has undefined behaviour at compile-time
11+
*/
912
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Patterns.patternHole`")
1013
def patternHole[T]: T = ???
1114

15+
/** A higher order splice in a quoted pattern is desugared by the compiler into a call to this method.
16+
*
17+
* Calling this method in source has undefined behaviour at compile-time
18+
*/
1219
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Patterns.patternHigherOrderHole`")
13-
/** A higher order splice in a quoted pattern is desugared by the compiler into a call to this method */
1420
def patternHigherOrderHole[U](pat: Any, args: Any*): U = ???
1521

22+
/** A higher order splice in a quoted pattern is desugared by the compiler into a call to this method.
23+
*
24+
* Calling this method in source has undefined behaviour at compile-time
25+
*/
1626
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Patterns.higherOrderHole`")
17-
/** A higher order splice in a quoted pattern is desugared by the compiler into a call to this method */
1827
def higherOrderHole[U](args: Any*): U = ???
1928

20-
/** A splice of a name in a quoted pattern is that marks the definition of a type splice */
29+
/** A splice of a name in a quoted pattern is that marks the definition of a type splice.
30+
*
31+
* Adding this annotation in source has undefined behaviour at compile-time
32+
*/
2133
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Patterns.patternType`")
2234
class patternType extends Annotation
2335

24-
/** A type pattern that must be aproximated from above */
36+
/** A type pattern that must be aproximated from above
37+
*
38+
* Adding this annotation in source has undefined behaviour at compile-time
39+
*/
2540
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.Patterns.fromAbove`")
2641
class fromAbove extends Annotation
2742

library/src/scala/quoted/runtime/SplicedType.scala

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import scala.annotation.{Annotation, compileTimeOnly}
99
* This artifact is removed during quote unpickling.
1010
*
1111
* See PickleQuotes.scala and PickledQuotes.scala
12+
*
13+
* Adding this annotation in source has undefined behaviour at compile-time
1214
*/
1315
@compileTimeOnly("Illegal reference to `scala.quoted.runtime.SplicedType`")
1416
class SplicedType extends Annotation

0 commit comments

Comments
 (0)