@@ -28,58 +28,58 @@ object Unliftable {
28
28
* - Unlifts `'{false}` into `Some(false)`
29
29
* - Otherwise unlifts to `None`
30
30
*/
31
- given BooleanUnliftable as Unliftable [Boolean ] = new PrimitiveUnliftable
31
+ given BooleanUnliftable [ T <: Boolean ] as Unliftable [T ] = new PrimitiveUnliftable
32
32
33
33
/** Default unliftable for Byte
34
34
* - Unlifts `'{n}` into `Some(n)` for a literal `n` of type `Byte`
35
35
* - Otherwise unlifts to `None`
36
36
*/
37
- given ByteUnliftable as Unliftable [Byte ] = new PrimitiveUnliftable
37
+ given ByteUnliftable [ T <: Byte ] as Unliftable [T ] = new PrimitiveUnliftable
38
38
39
39
/** Default unliftable for Short
40
40
* - Unlifts `'{n}` into `Some(n)` for a literal `n` of type `Short`
41
41
* - Otherwise unlifts to `None`
42
42
*/
43
- given ShortUnliftable as Unliftable [Short ] = new PrimitiveUnliftable
43
+ given ShortUnliftable [ T <: Short ] as Unliftable [T ] = new PrimitiveUnliftable
44
44
45
45
/** Default unliftable for Int
46
46
* - Unlifts `'{n}` into `Some(n)` for a literal `n` of type `Int`
47
47
* - Otherwise unlifts to `None`
48
48
*/
49
- given IntUnliftable as Unliftable [Int ] = new PrimitiveUnliftable
49
+ given IntUnliftable [ T <: Int ] as Unliftable [T ] = new PrimitiveUnliftable
50
50
51
51
/** Default unliftable for Long
52
52
* - Unlifts `'{n}` into `Some(n)` for a literal `n` of type `Long`
53
53
* - Otherwise unlifts to `None`
54
54
*/
55
- given LongUnliftable as Unliftable [Long ] = new PrimitiveUnliftable
55
+ given LongUnliftable [ T <: Long ] as Unliftable [T ] = new PrimitiveUnliftable
56
56
57
57
/** Default unliftable for Float
58
58
* - Unlifts `'{n}` into `Some(n)` for a literal `n` of type `Float`
59
59
* - Otherwise unlifts to `None`
60
60
*/
61
- given FloatUnliftable as Unliftable [Float ] = new PrimitiveUnliftable
61
+ given FloatUnliftable [ T <: Float ] as Unliftable [T ] = new PrimitiveUnliftable
62
62
63
63
/** Default unliftable for Double
64
64
* - Unlifts `'{n}` into `Some(n)` for a literal `n` of type `Double`
65
65
* - Otherwise unlifts to `None`
66
66
*/
67
- given DoubleUnliftable as Unliftable [Double ] = new PrimitiveUnliftable
67
+ given DoubleUnliftable [ T <: Double ] as Unliftable [T ] = new PrimitiveUnliftable
68
68
69
69
/** Default unliftable for Char
70
70
* - Unlifts `'{c}` into `Some(c)` for a literal `c` of type `Char`
71
71
* - Otherwise unlifts to `None`
72
72
*/
73
- given CharUnliftable as Unliftable [Char ] = new PrimitiveUnliftable
73
+ given CharUnliftable [ T <: Char ] as Unliftable [T ] = new PrimitiveUnliftable
74
74
75
75
/** Default unliftable for String
76
76
* - Unlifts `'{str}` into `Some(str)` for a literal `str` of type `String`
77
77
* - Otherwise unlifts to `None`
78
78
*/
79
- given StringUnliftable as Unliftable [String ] = new PrimitiveUnliftable
79
+ given StringUnliftable [ T <: String ] as Unliftable [T ] = new PrimitiveUnliftable
80
80
81
81
/** Lift a quoted primitive value `'{ x }` into `x` */
82
- private class PrimitiveUnliftable [T <: Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String ] extends Unliftable [T ] {
82
+ private class PrimitiveUnliftable [T <: Boolean | Byte | Short | Int | Long | Float | Double | Char | String ] extends Unliftable [T ] {
83
83
def fromExpr (expr : Expr [T ]) =
84
84
import quotes .reflect ._
85
85
def rec (tree : Term ): Option [T ] = tree match {
0 commit comments