Skip to content

Remove Unliftable[Unit] #10570

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
Dec 1, 2020
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
5 changes: 1 addition & 4 deletions library/src-bootstrapped/scala/quoted/Unliftable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ trait Unliftable[T] {

object Unliftable {

/** Default unliftable for Unit */
given UnitUnliftable as Unliftable[Unit] = new PrimitiveUnliftable

/** Default unliftable for Boolean */
given BooleanUnliftable as Unliftable[Boolean] = new PrimitiveUnliftable

Expand Down Expand Up @@ -44,7 +41,7 @@ object Unliftable {
/** Default unliftable for String */
given StringUnliftable as Unliftable[String] = new PrimitiveUnliftable

private class PrimitiveUnliftable[T <: Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String] extends Unliftable[T] {
private class PrimitiveUnliftable[T <: Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String] extends Unliftable[T] {
/** Lift a quoted primitive value `'{ n }` into `n` */
def fromExpr(x: Expr[T]) = Const.unapply(x)
}
Expand Down
1 change: 0 additions & 1 deletion tests/run-staging/quote-valueof.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Some(())
Some(true)
Some(1)
Some(2)
Expand Down
1 change: 0 additions & 1 deletion tests/run-staging/quote-valueof.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ object Test {
given Toolbox = Toolbox.make(getClass.getClassLoader)

def main(args: Array[String]): Unit = withQuotes {
println(('{}).unlift)
println(('{true}).unlift)
println(('{1}).unlift)
println(('{2: Byte}).unlift)
Expand Down