@@ -156,11 +156,11 @@ given ToExpr[Boolean] with {
156156given ToExpr [StringContext ] with {
157157 def apply (stringContext : StringContext )(using Quotes ) =
158158 val parts = Varargs (stringContext.parts.map(Expr (_)))
159- ' { StringContext ($parts : _ * ) }
159+ ' { StringContext ($parts* ) }
160160}
161161```
162162The ` Varargs ` constructor just creates an ` Expr[Seq[T]] ` which we can efficiently splice as a varargs.
163- In general, any sequence can be spliced with ` $mySeq: _ * ` to splice it as a varargs.
163+ In general, any sequence can be spliced with ` $mySeq* ` to splice it as a varargs.
164164
165165## Quoted patterns
166166Quotes can also be used to check if an expression is equivalent to another or to deconstruct an expression into its parts.
@@ -352,7 +352,7 @@ Types represented with `Type[T]` can be matched on using the patten `case '[...]
352352inline def mirrorFields [T ]: List [String ] = $ {mirrorFieldsImpl[T ]}
353353
354354def mirrorFieldsImpl [T : Type ](using Quotes ): Expr [List [String ]] =
355-
355+
356356 def rec [A : Type ]: List [String ] = Type .of[A ] match
357357 case ' [field *: fields] =>
358358 Type .show[field] :: rec[fields]
@@ -408,8 +408,8 @@ given FromExpr[Boolean] with {
408408
409409given FromExpr [StringContext ] with {
410410 def unapply (x : Expr [StringContext ])(using Quotes ): Option [StringContext ] = x match {
411- case ' { new StringContext ($ {Varargs (Exprs (args))}: _ * ) } => Some (StringContext (args : _ * ))
412- case ' { StringContext ($ {Varargs (Exprs (args))}: _ * ) } => Some (StringContext (args : _ * ))
411+ case ' { new StringContext ($ {Varargs (Exprs (args))}* ) } => Some (StringContext (args* ))
412+ case ' { StringContext ($ {Varargs (Exprs (args))}* ) } => Some (StringContext (args* ))
413413 case _ => None
414414 }
415415}
0 commit comments