Skip to content

Commit 7538a32

Browse files
committed
Fix syntax change for Splice after rebase
1 parent 4e58ba1 commit 7538a32

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

tests/neg-with-compiler/i5941/macro_1.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ object Lens {
3131
)
3232
) if o.symbol == param.symbol =>
3333
'{
34-
val setter = (t: T) => (s: S) => ~setterBody('(s), '(t), field)
35-
apply(~getter)(setter)
34+
val setter = (t: T) => (s: S) => ${ setterBody('s, 't, field) }
35+
apply($getter)(setter)
3636
}
3737
case _ =>
3838
throw new QuoteError("Unsupported syntax. Example: `GenLens[Address](_.streetNumber)`")
@@ -50,6 +50,6 @@ object GenLens {
5050

5151
def apply[S] = new MkGenLens[S]
5252
class MkGenLens[S] {
53-
inline def apply[T](get: => (S => T)): Lens[S, T] = ~Lens.impl('(get))
53+
inline def apply[T](get: => (S => T)): Lens[S, T] = ${ Lens.impl('get) }
5454
}
5555
}

tests/run-with-compiler/i5941/macro_1.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ object Lens {
5858
getter.unseal match {
5959
case Function(param :: Nil, Path(o, parts)) if o.symbol == param.symbol =>
6060
'{
61-
val setter = (t: T) => (s: S) => ~setterBody(('(s)).unseal, ('(t)).unseal, parts).seal[S]
62-
apply(~getter)(setter)
61+
val setter = (t: T) => (s: S) => ${ setterBody(('s).unseal, ('t).unseal, parts).seal[S] }
62+
apply($getter)(setter)
6363
}
6464
case _ =>
6565
throw new QuoteError("Unsupported syntax. Example: `GenLens[Address](_.streetNumber)`")
@@ -77,7 +77,7 @@ object GenLens {
7777

7878
def apply[S] = new MkGenLens[S]
7979
class MkGenLens[S] {
80-
inline def apply[T](get: => (S => T)): Lens[S, T] = ~Lens.impl('(get))
80+
inline def apply[T](get: => (S => T)): Lens[S, T] = ${ Lens.impl('get) }
8181
}
8282
}
8383

@@ -122,9 +122,9 @@ object Iso {
122122

123123
'{
124124
// (p: S) => p._1
125-
val to = (p: S) => ~{ Term.Select.unique(('(p)).unseal, "_1").seal[A] }
125+
val to = (p: S) => ${ Term.Select.unique(('p).unseal, "_1").seal[A] }
126126
// (p: A) => S(p)
127-
val from = (p: A) => ~{ Term.Select.overloaded(Term.Ident(companion), "apply", Nil, ('(p)).unseal :: Nil).seal[S] }
127+
val from = (p: A) => ${ Term.Select.overloaded(Term.Ident(companion), "apply", Nil, ('p).unseal :: Nil).seal[S] }
128128
apply(from)(to)
129129
}
130130
}
@@ -139,7 +139,7 @@ object Iso {
139139
if (tpS.isSingleton) {
140140
val ident = Term.Ident(tpS.asInstanceOf[TermRef]).seal[S]
141141
'{
142-
Iso[S, 1](Function.const(~ident))(Function.const(1))
142+
Iso[S, 1](Function.const($ident))(Function.const(1))
143143
}
144144
}
145145
else if (tpS.classSymbol.flatMap(cls => if (cls.flags.is(Flags.Case)) Some(true) else None).nonEmpty) {
@@ -156,7 +156,7 @@ object Iso {
156156
val obj = Term.Select.overloaded(Term.Ident(companion), "apply", Nil, Nil).seal[S]
157157

158158
'{
159-
Iso[S, 1](Function.const(~obj))(Function.const(1))
159+
Iso[S, 1](Function.const($obj))(Function.const(1))
160160
}
161161
}
162162
else {
@@ -176,12 +176,12 @@ object GenIso {
176176
* { p => p._1 }
177177
* { p => Person(p) }
178178
*/
179-
inline def apply[S, A]: Iso[S, A] = ~Iso.impl[S, A]
179+
inline def apply[S, A]: Iso[S, A] = ${ Iso.impl[S, A] }
180180

181181
// TODO: require whitebox macro
182-
inline def fields[S]: Iso[S, Any] = ~Iso.implFields[S]
182+
inline def fields[S]: Iso[S, Any] = ${ Iso.implFields[S] }
183183

184-
inline def unit[S]: Iso[S, 1] = ~Iso.implUnit[S]
184+
inline def unit[S]: Iso[S, 1] = ${ Iso.implUnit[S] }
185185
}
186186

187187
trait Prism[S, A] { outer =>
@@ -221,5 +221,5 @@ object GenPrism {
221221
* case _ => None
222222
* }(jstr => jstr)
223223
*/
224-
inline def apply[S, A <: S]: Prism[S, A] = ~Prism.impl[S, A]
224+
inline def apply[S, A <: S]: Prism[S, A] = ${ Prism.impl[S, A] }
225225
}

0 commit comments

Comments
 (0)