@@ -6,7 +6,7 @@ import scala.reflect.TypeTest
6
6
/** Current Quotes in scope
7
7
*
8
8
* Usage:
9
- * ```scala
9
+ * ```scala sc:nocompile
10
10
* def myExpr[T](using Quotes): Expr[T] = {
11
11
* import quotes.reflect._
12
12
* ...
@@ -31,7 +31,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
31
31
32
32
/** Pattern matches `this` against `that`. Effectively performing a deep equality check.
33
33
* It does the equivalent of
34
- * ```scala
34
+ * ```scala sc:nocompile
35
35
* this match
36
36
* case '{...} => true // where the contents of the pattern are the contents of `that`
37
37
* case _ => false
@@ -91,7 +91,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
91
91
* def f(expr: Expr[Int])(using Quotes) =
92
92
* import quotes.reflect._
93
93
* val ast: Term = expr.asTerm
94
- * ...
94
+ * ???
95
95
* ```
96
96
*
97
97
* See `reflectModule` for full API.
@@ -294,15 +294,15 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
294
294
295
295
/** Tree representing a package clause in the source code
296
296
*
297
- * ```scala
297
+ * ```scala sc:nocompile
298
298
* package foo {
299
- * // package stats
299
+ * // package stats
300
300
* }
301
301
* ```
302
302
*
303
303
* or
304
304
*
305
- * ```scala
305
+ * ```scala sc:nocompile
306
306
* package foo.bar
307
307
* // package stats
308
308
* ```
@@ -473,8 +473,11 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
473
473
/** Self-type of the class
474
474
*
475
475
* ```scala
476
+ * //{
477
+ * type T
478
+ * //}
476
479
* class C { self: T =>
477
- * ...
480
+ * ???
478
481
* }
479
482
* ```
480
483
* @syntax markdown
@@ -484,7 +487,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
484
487
*
485
488
* ```scala
486
489
* class C {
487
- * ... // statements
490
+ * ??? // statements
488
491
* }
489
492
* ```
490
493
* @syntax markdown
@@ -532,7 +535,11 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
532
535
*
533
536
* Note: Non leading type parameters can be found in extension methods such as
534
537
* ```scala
535
- * extension (a: A) def f[T]() = ...
538
+ * //{
539
+ * type A
540
+ * type T
541
+ * //}
542
+ * extension (a: A) def f[T]() = ???
536
543
* ```
537
544
* @syntax markdown
538
545
*/
@@ -543,7 +550,11 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
543
550
*
544
551
* Non leading type parameters can be found in extension methods such as
545
552
* ```scala
546
- * extension (a: A) def f[T]() = ...
553
+ * //{
554
+ * type T
555
+ * type A
556
+ * //}
557
+ * extension (a: A) def f[T]() = ???
547
558
* ```
548
559
* @syntax markdown
549
560
*/
@@ -1014,7 +1025,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
1014
1025
*
1015
1026
* It may be a partially applied method:
1016
1027
* ```scala
1017
- * def f(x1: Int)(x2: Int) = ...
1028
+ * def f(x1: Int)(x2: Int) = ???
1018
1029
* f(1)(2)
1019
1030
* ```
1020
1031
* - `fun` is `f(1)` in the `Apply` of `f(1)(2)`
@@ -1026,7 +1037,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
1026
1037
*
1027
1038
* The `Apply` may be a partially applied method:
1028
1039
* ```scala
1029
- * def f(x1: Int)(x2: Int) = ...
1040
+ * def f(x1: Int)(x2: Int) = ???
1030
1041
* f(1)(2)
1031
1042
* ```
1032
1043
* - `args` is `(2)` in the `Apply` of `f(1)(2)`
@@ -1068,9 +1079,12 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
1068
1079
*
1069
1080
* It may be a partially applied method:
1070
1081
* ```scala
1071
- * extension (x: Int) def f[T](y: T) = ...
1082
+ * //{
1083
+ * type T
1084
+ * //}
1085
+ * extension (x: Int) def f[T](y: T) = ???
1072
1086
* // represented as
1073
- * // def f(x: Int)[T](y: T) = ...
1087
+ * // def f(x: Int)[T](y: T) = ???
1074
1088
*
1075
1089
* 1.f[Int](2)
1076
1090
* // represented as
@@ -1084,9 +1098,12 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
1084
1098
*
1085
1099
* The `TypeApply` may be a partially applied method:
1086
1100
* ```scala
1087
- * extension (x: Int) def f[T](y: T) = ...
1101
+ * //{
1102
+ * type T
1103
+ * //}
1104
+ * extension (x: Int) def f[T](y: T) = ???
1088
1105
* // represented as
1089
- * // def f(x: Int)[T](y: T) = ...
1106
+ * // def f(x: Int)[T](y: T) = ???
1090
1107
*
1091
1108
* 1.f[Int](2)
1092
1109
* // represented as
@@ -1273,7 +1290,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
1273
1290
/** A lambda `(...) => ...` in the source code is represented as
1274
1291
* a local method and a closure:
1275
1292
*
1276
- * ```scala
1293
+ * ```scala sc:nocompile
1277
1294
* {
1278
1295
* def m(...) = ...
1279
1296
* closure(m)
@@ -1289,7 +1306,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
1289
1306
/** Methods of the module object `val Lambda` */
1290
1307
trait LambdaModule { this : Lambda .type =>
1291
1308
/** Matches a lambda definition of the form
1292
- * ```scala
1309
+ * ```scala sc:nocompile
1293
1310
* Block((DefDef(_, _, params :: Nil, _, Some(body))) :: Nil, Closure(meth, _))
1294
1311
* ```
1295
1312
* Extracts the parameter definitions and body.
@@ -1298,7 +1315,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
1298
1315
def unapply (tree : Block ): Option [(List [ValDef ], Term )]
1299
1316
1300
1317
/** Generates a lambda with the given method type.
1301
- * ```scala
1318
+ * ```scala sc:nocompile
1302
1319
* Block((DefDef(_, _, params :: Nil, _, Some(rhsFn(meth, paramRefs)))) :: Nil, Closure(meth, _))
1303
1320
* ```
1304
1321
* @param owner: owner of the generated `meth` symbol
@@ -2432,9 +2449,16 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
2432
2449
*
2433
2450
* Usage:
2434
2451
* ```scala
2452
+ * //{
2453
+ * def f(using Quotes) = {
2454
+ * val typeRepr: TypeRepr = ???
2455
+ * //}
2435
2456
* typeRepr.asType match
2436
2457
* case '[t] =>
2437
- * '{ val x: t = ... }
2458
+ * '{ val x: t = ??? }
2459
+ * //{
2460
+ * }
2461
+ * //}
2438
2462
* ```
2439
2463
* @syntax markdown
2440
2464
*/
@@ -2809,12 +2833,15 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
2809
2833
*
2810
2834
* May represent by-name parameter such as `thunk` in
2811
2835
* ```scala
2812
- * def log[T](thunk: =>T): T = ...
2836
+ * //{
2837
+ * type T
2838
+ * //}
2839
+ * def log[T](thunk: => T): T = ???
2813
2840
* ```
2814
2841
*
2815
2842
* May also represent a the return type of a parameterless method definition such as
2816
2843
* ```scala
2817
- * def foo: Int = ...
2844
+ * def foo: Int = ???
2818
2845
* ```
2819
2846
* @syntax markdown
2820
2847
*/
@@ -3451,7 +3478,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
3451
3478
/** Symbol of the definition that encloses the current splicing context.
3452
3479
*
3453
3480
* For example, the following call to `spliceOwner` would return the symbol `x`.
3454
- * ```scala
3481
+ * ```scala sc:nocompile
3455
3482
* val x = ${ ... Symbol.spliceOwner ... }
3456
3483
* ```
3457
3484
*
@@ -4298,9 +4325,8 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
4298
4325
*
4299
4326
* Usage:
4300
4327
* ```scala
4301
- * import quotes.reflect._
4302
- * class MyTreeAccumulator extends TreeAccumulator[X] {
4303
- * def foldTree(x: X, tree: Tree)(owner: Symbol): X = ...
4328
+ * class MyTreeAccumulator[X] extends TreeAccumulator[X] {
4329
+ * def foldTree(x: X, tree: Tree)(owner: Symbol): X = ???
4304
4330
* }
4305
4331
* ```
4306
4332
* @syntax markdown
@@ -4402,9 +4428,8 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
4402
4428
*
4403
4429
* Usage:
4404
4430
* ```scala
4405
- * import quotes.reflect._
4406
4431
* class MyTraverser extends TreeTraverser {
4407
- * override def traverseTree(tree: Tree)(owner: Symbol): Unit = ...
4432
+ * override def traverseTree(tree: Tree)(owner: Symbol): Unit = ???
4408
4433
* }
4409
4434
* ```
4410
4435
* @syntax markdown
@@ -4423,9 +4448,8 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
4423
4448
*
4424
4449
* Usage:
4425
4450
* ```scala
4426
- * import quotes.reflect._
4427
4451
* class MyTreeMap extends TreeMap {
4428
- * override def transformTree(tree: Tree)(owner: Symbol): Tree = ...
4452
+ * override def transformTree(tree: Tree)(owner: Symbol): Tree = ???
4429
4453
* }
4430
4454
* ```
4431
4455
* @syntax markdown
0 commit comments