Skip to content

Remove quoted.Liftable for Unit #4123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion library/src/scala/quoted/Liftable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ object Liftable {
def toExpr(implicit liftable: Liftable[T]): Expr[T] = liftable.toExpr(x)
}

implicit def UnitIsLiftable: Liftable[Unit] = (x: Unit) => new ValueExpr(x)
implicit def BooleanIsLiftable: Liftable[Boolean] = (x: Boolean) => new ValueExpr(x)
implicit def ByteLiftable: Liftable[Byte] = (x: Byte) => new ValueExpr(x)
implicit def CharIsLiftable: Liftable[Char] = (x: Char) => new ValueExpr(x)
Expand Down
4 changes: 2 additions & 2 deletions tests/pos/macro-with-type/Macro_1.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import scala.quoted._
object Macro {
inline def ff: Unit = ~impl('[Int])
def impl(t: Type[Int]): Expr[Unit] = ()
}
def impl(t: Type[Int]): Expr[Unit] = '()
}
1 change: 0 additions & 1 deletion tests/pos/quote-liftable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ object Test {
(1.0f: Expr[Float])
(1.0: Expr[Double])
("abc": Expr[String])
((): Expr[Unit])

val xs: Expr[List[Int]] = 1 :: 2 :: 3 :: Nil
}
2 changes: 1 addition & 1 deletion tests/run-with-compiler/i3946.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import dotty.tools.dotc.quoted.Toolbox._
import scala.quoted._
object Test {
def main(args: Array[String]): Unit = {
val u: Expr[Unit] = ()
val u: Expr[Unit] = '()
println(u.show)
println(u.run)
}
Expand Down
4 changes: 2 additions & 2 deletions tests/run-with-compiler/quote-show-blocks-raw.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ object Test {
if (n == 0) x
else a(n - 1, '{ println(~n.toExpr); ~x })

println(a(5, ()).show)
println(a(5, '()).show)


def b(n: Int, x: Expr[Unit]): Expr[Unit] =
if (n == 0) x
else b(n - 1, '{ ~x; println(~n.toExpr) })

println(b(5, ()).show)
println(b(5, '()).show)
}

}
4 changes: 2 additions & 2 deletions tests/run-with-compiler/quote-show-blocks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ object Test {
if (n == 0) x
else a(n - 1, '{ println(~n.toExpr); ~x })

println(a(5, ()).show)
println(a(5, '()).show)


def b(n: Int, x: Expr[Unit]): Expr[Unit] =
if (n == 0) x
else b(n - 1, '{ ~x; println(~n.toExpr) })

println(b(5, ()).show)
println(b(5, '()).show)
}

}