Skip to content

Commit ff43160

Browse files
Merge pull request #7054 from dotty-staging/fix-comment-var
Fix comment for Var
2 parents 19da711 + c74aa83 commit ff43160

File tree

1 file changed

+6
-6
lines changed
  • library/src-bootstrapped/scala/quoted/util

1 file changed

+6
-6
lines changed

library/src-bootstrapped/scala/quoted/util/Var.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ object Var {
1717
/** Create a variable initialized with `init` and used in `body`.
1818
* `body` recieves a `Var[T]` argument which exposes `get` and `update`.
1919
*
20-
* `var`('(7)) {
20+
* Var('{7}) {
2121
* x => '{
22-
* while(0 < ~x)
23-
* ~x.update('(~x - 1))
24-
* ~x.get
22+
* while(0 < ${x.get})
23+
* ${x.update('{${x.get} - 1})}
24+
* ${x.get}
2525
* }
2626
* }
2727
*
28-
* will create the equivalent of
28+
* will create the equivalent of:
2929
*
3030
* '{
3131
* var x = 7
3232
* while (0 < x)
3333
* x = x - 1
34-
* x
34+
* x
3535
* }
3636
*/
3737
def apply[T: Type, U: Type](init: Expr[T])(body: Var[T] => Expr[U]) given QuoteContext: Expr[U] = '{

0 commit comments

Comments
 (0)