@@ -49,7 +49,7 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
49
49
}
50
50
51
51
def ConstantTypeDeco (x : ConstantType ): ConstantTypeAPI = new ConstantTypeAPI {
52
-
52
+ def value ( implicit ctx : Context ) : Any = x.value
53
53
}
54
54
55
55
object ConstantType extends ConstantTypeExtractor {
@@ -60,7 +60,7 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
60
60
}
61
61
62
62
object IsSymRef extends IsSymRefModule {
63
- def unapply (tpe : TypeOrBounds )(implicit ctx : Context ): Option [SymRef ] = tpe match {
63
+ def unapply (tpe : TypeOrBounds )(implicit ctx : Context ): Option [SymRef ] = tpe match {
64
64
case tp : Types .NamedType =>
65
65
tp.designator match {
66
66
case sym : Symbol => Some (tp)
@@ -71,7 +71,7 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
71
71
}
72
72
73
73
def SymRefDeco (x : SymRef ): SymRefAPI = new SymRefAPI {
74
-
74
+ def qualifier ( implicit ctx : Context ) : TypeOrBounds = x.prefix
75
75
}
76
76
77
77
object SymRef extends SymRefExtractor {
@@ -97,7 +97,7 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
97
97
}
98
98
99
99
def TermRefDeco (x : TermRef ): TermRefAPI = new TermRefAPI {
100
-
100
+ def qualifier ( implicit ctx : Context ) : TypeOrBounds = x.prefix
101
101
}
102
102
103
103
object TermRef extends TermRefExtractor {
@@ -123,7 +123,8 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
123
123
}
124
124
125
125
def TypeRefDeco (x : TypeRef ): TypeRefAPI = new TypeRefAPI {
126
-
126
+ def name (implicit ctx : Context ): String = x.name.toString
127
+ def qualifier (implicit ctx : Context ): TypeOrBounds = x.prefix
127
128
}
128
129
129
130
object TypeRef extends TypeRefExtractor {
@@ -145,7 +146,8 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
145
146
}
146
147
147
148
def SuperTypeDeco (x : SuperType ): SuperTypeAPI = new SuperTypeAPI {
148
-
149
+ def thistpe (implicit ctx : Context ): Type = x.thistpe
150
+ def supertpe (implicit ctx : Context ): Type = x.supertpe
149
151
}
150
152
151
153
object SuperType extends SuperTypeExtractor {
@@ -163,7 +165,9 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
163
165
}
164
166
165
167
def RefinementDeco (x : Refinement ): RefinementAPI = new RefinementAPI {
166
-
168
+ def parent (implicit ctx : Context ): Type = x.parent
169
+ def name (implicit ctx : Context ): String = x.refinedName.toString
170
+ def info (implicit ctx : Context ): TypeOrBounds = x.refinedInfo
167
171
}
168
172
169
173
object Refinement extends RefinementExtractor {
@@ -181,7 +185,8 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
181
185
}
182
186
183
187
def AppliedTypeDeco (x : AppliedType ): AppliedTypeAPI = new AppliedTypeAPI {
184
-
188
+ def tycon (implicit ctx : Context ): Type = x.tycon
189
+ def args (implicit ctx : Context ): List [TypeOrBounds ] = x.args
185
190
}
186
191
187
192
object AppliedType extends AppliedTypeExtractor {
@@ -199,7 +204,8 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
199
204
}
200
205
201
206
def AnnotatedTypeDeco (x : AnnotatedType ): AnnotatedTypeAPI = new AnnotatedTypeAPI {
202
-
207
+ def underlying (implicit ctx : Context ): Type = x.underlying.stripTypeVar
208
+ def annot (implicit ctx : Context ): Term = x.annot.tree
203
209
}
204
210
205
211
object AnnotatedType extends AnnotatedTypeExtractor {
@@ -217,7 +223,8 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
217
223
}
218
224
219
225
def AndTypeDeco (x : AndType ): AndTypeAPI = new AndTypeAPI {
220
-
226
+ def left (implicit ctx : Context ): Type = x.tp1.stripTypeVar
227
+ def right (implicit ctx : Context ): Type = x.tp2.stripTypeVar
221
228
}
222
229
223
230
object AndType extends AndTypeExtractor {
@@ -235,7 +242,8 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
235
242
}
236
243
237
244
def OrTypeDeco (x : OrType ): OrTypeAPI = new OrTypeAPI {
238
-
245
+ def left (implicit ctx : Context ): Type = x.tp1
246
+ def right (implicit ctx : Context ): Type = x.tp2
239
247
}
240
248
241
249
object OrType extends OrTypeExtractor {
@@ -253,7 +261,9 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
253
261
}
254
262
255
263
def MatchTypeDeco (x : MatchType ): MatchTypeAPI = new MatchTypeAPI {
256
-
264
+ def bound (implicit ctx : Context ): Type = x.bound
265
+ def scrutinee (implicit ctx : Context ): Type = x.scrutinee
266
+ def cases (implicit ctx : Context ): List [Type ] = x.cases
257
267
}
258
268
259
269
object MatchType extends MatchTypeExtractor {
@@ -271,7 +281,7 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
271
281
}
272
282
273
283
def ByNameTypeDeco (x : ByNameType ): ByNameTypeAPI = new ByNameTypeAPI {
274
-
284
+ def underlying ( implicit ctx : Context ) : Type = x.resType.stripTypeVar
275
285
}
276
286
277
287
object ByNameType extends ByNameTypeExtractor {
@@ -290,7 +300,9 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
290
300
}
291
301
292
302
def ParamRefDeco (x : ParamRef ): ParamRefAPI = new ParamRefAPI {
293
-
303
+ def binder (implicit ctx : Context ): LambdaType [TypeOrBounds ] =
304
+ x.binder.asInstanceOf [LambdaType [TypeOrBounds ]] // Cast to tpd
305
+ def paramNum (implicit ctx : Context ): Int = x.paramNum
294
306
}
295
307
296
308
object ParamRef extends ParamRefExtractor {
@@ -312,7 +324,7 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
312
324
}
313
325
314
326
def ThisTypeDeco (x : ThisType ): ThisTypeAPI = new ThisTypeAPI {
315
-
327
+ def underlying ( implicit ctx : Context ) : Type = x.underlying
316
328
}
317
329
318
330
object ThisType extends ThisTypeExtractor {
@@ -330,7 +342,7 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
330
342
}
331
343
332
344
def RecursiveThisDeco (x : RecursiveThis ): RecursiveThisAPI = new RecursiveThisAPI {
333
-
345
+ def binder ( implicit ctx : Context ) : RecursiveType = x.binder
334
346
}
335
347
336
348
object RecursiveThis extends RecursiveThisExtractor {
@@ -348,7 +360,7 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
348
360
}
349
361
350
362
def RecursiveTypeDeco (x : RecursiveType ): RecursiveTypeAPI = new RecursiveTypeAPI {
351
-
363
+ def underlying ( implicit ctx : Context ) : Type = x.underlying.stripTypeVar
352
364
}
353
365
354
366
object RecursiveType extends RecursiveTypeExtractor {
@@ -366,7 +378,9 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
366
378
}
367
379
368
380
def MethodTypeDeco (x : MethodType ): MethodTypeAPI = new MethodTypeAPI {
369
-
381
+ def paramNames (implicit ctx : Context ): List [String ] = x.paramNames.map(_.toString)
382
+ def paramTypes (implicit ctx : Context ): List [Type ] = x.paramInfos
383
+ def resType (implicit ctx : Context ): Type = x.resType
370
384
}
371
385
372
386
object MethodType extends MethodTypeExtractor {
@@ -384,7 +398,9 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
384
398
}
385
399
386
400
def PolyTypeDeco (x : PolyType ): PolyTypeAPI = new PolyTypeAPI {
387
-
401
+ def paramNames (implicit ctx : Contexts .Context ): List [String ] = x.paramNames.map(_.toString)
402
+ def paramBounds (implicit ctx : Contexts .Context ): List [TypeBounds ] = x.paramInfos
403
+ def resType (implicit ctx : Contexts .Context ): Type = x.resType
388
404
}
389
405
390
406
object PolyType extends PolyTypeExtractor {
@@ -402,7 +418,9 @@ trait TypeOrBoundsOpsImpl extends scala.tasty.reflect.TypeOrBoundsOps with CoreI
402
418
}
403
419
404
420
def TypeLambdaDeco (x : TypeLambda ): TypeLambdaAPI = new TypeLambdaAPI {
405
-
421
+ def paramNames (implicit ctx : Contexts .Context ): List [String ] = x.paramNames.map(_.toString)
422
+ def paramBounds (implicit ctx : Contexts .Context ): List [TypeBounds ] = x.paramInfos
423
+ def resType (implicit ctx : Contexts .Context ): Type = x.resType
406
424
}
407
425
408
426
object TypeLambda extends TypeLambdaExtractor {
0 commit comments