@@ -46,49 +46,34 @@ object Type {
46
46
new Matcher .QuoteMatcher [qctx2.type ](qctx2).typeTreeMatch(scrutineeType.unseal, patternType.unseal, hasTypeSplices).asInstanceOf [Option [Tup ]]
47
47
}
48
48
49
- def Unit : QuoteContext ?=> quoted.Type [Unit ] =
50
- val qctx1 = quoteContextWithCompilerInterface(qctx)
51
- qctx1.tasty.Definitions_UnitType .seal.asInstanceOf [quoted.Type [Unit ]]
52
49
50
+ // TODO generalize following optimizations for all classes without parameters
53
51
54
- def Boolean : QuoteContext ?=> quoted.Type [Boolean ] =
55
- val qctx1 = quoteContextWithCompilerInterface(qctx)
56
- qctx1.tasty.Definitions_BooleanType .seal.asInstanceOf [quoted.Type [Boolean ]]
52
+ def Unit : QuoteContext ?=> quoted.Type [Unit ] =
53
+ qctx.tasty.Type .typeConstructorOf(classOf [Unit ]).seal.asInstanceOf [quoted.Type [Unit ]]
57
54
55
+ def Boolean : QuoteContext ?=> quoted.Type [Boolean ] =
56
+ qctx.tasty.Type .typeConstructorOf(classOf [Boolean ]).seal.asInstanceOf [quoted.Type [Boolean ]]
58
57
59
58
def Byte : QuoteContext ?=> quoted.Type [Byte ] =
60
- val qctx1 = quoteContextWithCompilerInterface(qctx)
61
- qctx1.tasty.Definitions_ByteType .seal.asInstanceOf [quoted.Type [Byte ]]
62
-
59
+ qctx.tasty.Type .typeConstructorOf(classOf [Byte ]).seal.asInstanceOf [quoted.Type [Byte ]]
63
60
64
61
def Char : QuoteContext ?=> quoted.Type [Char ] =
65
- val qctx1 = quoteContextWithCompilerInterface(qctx)
66
- qctx1.tasty.Definitions_CharType .seal.asInstanceOf [quoted.Type [Char ]]
67
-
62
+ qctx.tasty.Type .typeConstructorOf(classOf [Char ]).seal.asInstanceOf [quoted.Type [Char ]]
68
63
69
64
def Short : QuoteContext ?=> quoted.Type [Short ] =
70
- val qctx1 = quoteContextWithCompilerInterface(qctx)
71
- qctx1.tasty.Definitions_ShortType .seal.asInstanceOf [quoted.Type [Short ]]
72
-
65
+ qctx.tasty.Type .typeConstructorOf(classOf [Short ]).seal.asInstanceOf [quoted.Type [Short ]]
73
66
74
67
def Int : QuoteContext ?=> quoted.Type [Int ] =
75
- val qctx1 = quoteContextWithCompilerInterface(qctx)
76
- qctx1.tasty.Definitions_IntType .seal.asInstanceOf [quoted.Type [Int ]]
77
-
68
+ qctx.tasty.Type .typeConstructorOf(classOf [Int ]).seal.asInstanceOf [quoted.Type [Int ]]
78
69
79
70
def Long : QuoteContext ?=> quoted.Type [Long ] =
80
- val qctx1 = quoteContextWithCompilerInterface(qctx)
81
- qctx1.tasty.Definitions_LongType .seal.asInstanceOf [quoted.Type [Long ]]
82
-
71
+ qctx.tasty.Type .typeConstructorOf(classOf [Long ]).seal.asInstanceOf [quoted.Type [Long ]]
83
72
84
73
def Float : QuoteContext ?=> quoted.Type [Float ] =
85
- val qctx1 = quoteContextWithCompilerInterface(qctx)
86
- qctx1.tasty.Definitions_FloatType .seal.asInstanceOf [quoted.Type [Float ]]
87
-
74
+ qctx.tasty.Type .typeConstructorOf(classOf [Float ]).seal.asInstanceOf [quoted.Type [Float ]]
88
75
89
76
def Double : QuoteContext ?=> quoted.Type [Double ] =
90
- val qctx1 = quoteContextWithCompilerInterface(qctx)
91
- qctx1.tasty.Definitions_DoubleType .seal.asInstanceOf [quoted.Type [Double ]]
92
-
77
+ qctx.tasty.Type .typeConstructorOf(classOf [Double ]).seal.asInstanceOf [quoted.Type [Double ]]
93
78
94
79
}
0 commit comments