@@ -46,49 +46,34 @@ object Type {
4646 new Matcher .QuoteMatcher [qctx2.type ](qctx2).typeTreeMatch(scrutineeType.unseal, patternType.unseal, hasTypeSplices).asInstanceOf [Option [Tup ]]
4747 }
4848
49- def Unit : QuoteContext ?=> quoted.Type [Unit ] =
50- val qctx1 = quoteContextWithCompilerInterface(qctx)
51- qctx1.tasty.Definitions_UnitType .seal.asInstanceOf [quoted.Type [Unit ]]
5249
50+ // TODO generalize following optimizations for all classes without parameters
5351
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 ]]
5754
55+ def Boolean : QuoteContext ?=> quoted.Type [Boolean ] =
56+ qctx.tasty.Type .typeConstructorOf(classOf [Boolean ]).seal.asInstanceOf [quoted.Type [Boolean ]]
5857
5958 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 ]]
6360
6461 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 ]]
6863
6964 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 ]]
7366
7467 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 ]]
7869
7970 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 ]]
8372
8473 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 ]]
8875
8976 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 ]]
9378
9479}
0 commit comments