Skip to content

Commit 90f44d4

Browse files
Merge pull request #10570 from dotty-staging/improve-unliftable
Remove Unliftable[Unit]
2 parents 6a6a876 + 8064b27 commit 90f44d4

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

library/src-bootstrapped/scala/quoted/Unliftable.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ trait Unliftable[T] {
1414

1515
object Unliftable {
1616

17-
/** Default unliftable for Unit */
18-
given UnitUnliftable as Unliftable[Unit] = new PrimitiveUnliftable
19-
2017
/** Default unliftable for Boolean */
2118
given BooleanUnliftable as Unliftable[Boolean] = new PrimitiveUnliftable
2219

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

47-
private class PrimitiveUnliftable[T <: Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String] extends Unliftable[T] {
44+
private class PrimitiveUnliftable[T <: Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String] extends Unliftable[T] {
4845
/** Lift a quoted primitive value `'{ n }` into `n` */
4946
def fromExpr(x: Expr[T]) = Const.unapply(x)
5047
}

tests/run-staging/quote-valueof.check

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
Some(())
21
Some(true)
32
Some(1)
43
Some(2)

tests/run-staging/quote-valueof.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ object Test {
66
given Toolbox = Toolbox.make(getClass.getClassLoader)
77

88
def main(args: Array[String]): Unit = withQuotes {
9-
println(('{}).unlift)
109
println(('{true}).unlift)
1110
println(('{1}).unlift)
1211
println(('{2: Byte}).unlift)

0 commit comments

Comments
 (0)