@@ -84,6 +84,10 @@ trait TypeOrBoundsOps extends Core {
84
84
internal.matchConstantType(typeOrBounds).map(_.constant)
85
85
}
86
86
87
+ given (self : ConstantType ) {
88
+ def constant (given ctx : Context ): Constant = internal.ConstantType_constant (self)
89
+ }
90
+
87
91
object IsTermRef {
88
92
/** Matches any TermRef and returns it */
89
93
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [TermRef ] =
@@ -97,6 +101,11 @@ trait TypeOrBoundsOps extends Core {
97
101
internal.matchTermRef(typeOrBounds).map(x => (x.qualifier, x.name))
98
102
}
99
103
104
+ given (self : TermRef ) {
105
+ def qualifier (given ctx : Context ): TypeOrBounds /* Type | NoPrefix */ = internal.TermRef_qualifier (self)
106
+ def name (given ctx : Context ): String = internal.TermRef_name (self)
107
+ }
108
+
100
109
object IsTypeRef {
101
110
/** Matches any TypeRef and returns it */
102
111
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [TypeRef ] =
@@ -108,6 +117,11 @@ trait TypeOrBoundsOps extends Core {
108
117
internal.matchTypeRef(typeOrBounds).map(x => (x.qualifier, x.name))
109
118
}
110
119
120
+ given (self : TypeRef ) {
121
+ def qualifier (given ctx : Context ): TypeOrBounds /* Type | NoPrefix */ = internal.TypeRef_qualifier (self)
122
+ def name (given ctx : Context ): String = internal.TypeRef_name (self)
123
+ }
124
+
111
125
object IsSuperType {
112
126
/** Matches any SuperType and returns it */
113
127
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [SuperType ] =
@@ -119,6 +133,11 @@ trait TypeOrBoundsOps extends Core {
119
133
internal.matchSuperType(typeOrBounds).map(x => (x.thistpe, x.supertpe))
120
134
}
121
135
136
+ given (self : SuperType ) {
137
+ def thistpe (given ctx : Context ): Type = internal.SuperType_thistpe (self)
138
+ def supertpe (given ctx : Context ): Type = internal.SuperType_supertpe (self)
139
+ }
140
+
122
141
object IsRefinement {
123
142
/** Matches any Refinement and returns it */
124
143
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [Refinement ] =
@@ -130,6 +149,12 @@ trait TypeOrBoundsOps extends Core {
130
149
internal.matchRefinement(typeOrBounds).map(x => (x.parent, x.name, x.info))
131
150
}
132
151
152
+ given (self : Refinement ) {
153
+ def parent (given ctx : Context ): Type = internal.Refinement_parent (self)
154
+ def name (given ctx : Context ): String = internal.Refinement_name (self)
155
+ def info (given ctx : Context ): TypeOrBounds = internal.Refinement_info (self)
156
+ }
157
+
133
158
object IsAppliedType {
134
159
/** Matches any AppliedType and returns it */
135
160
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [AppliedType ] =
@@ -143,6 +168,11 @@ trait TypeOrBoundsOps extends Core {
143
168
internal.matchAppliedType(typeOrBounds).map(x => (x.tycon, x.args))
144
169
}
145
170
171
+ given (self : AppliedType ) {
172
+ def tycon (given ctx : Context ): Type = internal.AppliedType_tycon (self)
173
+ def args (given ctx : Context ): List [TypeOrBounds /* Type | TypeBounds */ ] = internal.AppliedType_args (self)
174
+ }
175
+
146
176
object IsAnnotatedType {
147
177
/** Matches any AnnotatedType and returns it */
148
178
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [AnnotatedType ] =
@@ -154,6 +184,11 @@ trait TypeOrBoundsOps extends Core {
154
184
internal.matchAnnotatedType(typeOrBounds).map(x => (x.underlying, x.annot))
155
185
}
156
186
187
+ given (self : AnnotatedType ) {
188
+ def underlying (given ctx : Context ): Type = internal.AnnotatedType_underlying (self)
189
+ def annot (given ctx : Context ): Term = internal.AnnotatedType_annot (self)
190
+ }
191
+
157
192
object IsAndType {
158
193
/** Matches any AndType and returns it */
159
194
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [AndType ] =
@@ -165,6 +200,11 @@ trait TypeOrBoundsOps extends Core {
165
200
internal.matchAndType(typeOrBounds).map(x => (x.left, x.right))
166
201
}
167
202
203
+ given (self : AndType ) {
204
+ def left (given ctx : Context ): Type = internal.AndType_left (self)
205
+ def right (given ctx : Context ): Type = internal.AndType_right (self)
206
+ }
207
+
168
208
object IsOrType {
169
209
/** Matches any OrType and returns it */
170
210
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [OrType ] =
@@ -176,6 +216,11 @@ trait TypeOrBoundsOps extends Core {
176
216
internal.matchOrType(typeOrBounds).map(x => (x.left, x.right))
177
217
}
178
218
219
+ given (self : OrType ) {
220
+ def left (given ctx : Context ): Type = internal.OrType_left (self)
221
+ def right (given ctx : Context ): Type = internal.OrType_right (self)
222
+ }
223
+
179
224
object IsMatchType {
180
225
/** Matches any MatchType and returns it */
181
226
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [MatchType ] =
@@ -187,6 +232,12 @@ trait TypeOrBoundsOps extends Core {
187
232
internal.matchMatchType(typeOrBounds).map(x => (x.bound, x.scrutinee, x.cases))
188
233
}
189
234
235
+ given (self : MatchType ) {
236
+ def bound (given ctx : Context ): Type = internal.MatchType_bound (self)
237
+ def scrutinee (given ctx : Context ): Type = internal.MatchType_scrutinee (self)
238
+ def cases (given ctx : Context ): List [Type ] = internal.MatchType_cases (self)
239
+ }
240
+
190
241
object IsByNameType {
191
242
/** Matches any ByNameType and returns it */
192
243
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [ByNameType ] =
@@ -198,6 +249,10 @@ trait TypeOrBoundsOps extends Core {
198
249
internal.matchByNameType(typeOrBounds).map(_.underlying)
199
250
}
200
251
252
+ given (self : ByNameType ) {
253
+ def underlying (given ctx : Context ): Type = internal.ByNameType_underlying (self)
254
+ }
255
+
201
256
object IsParamRef {
202
257
/** Matches any ParamRef and returns it */
203
258
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [ParamRef ] =
@@ -209,6 +264,11 @@ trait TypeOrBoundsOps extends Core {
209
264
internal.matchParamRef(typeOrBounds).map(x => (x.binder, x.paramNum))
210
265
}
211
266
267
+ given (self : ParamRef ) {
268
+ def binder (given ctx : Context ): LambdaType [TypeOrBounds ] = internal.ParamRef_binder (self)
269
+ def paramNum (given ctx : Context ): Int = internal.ParamRef_paramNum (self)
270
+ }
271
+
212
272
object IsThisType {
213
273
/** Matches any ThisType and returns it */
214
274
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [ThisType ] =
@@ -220,6 +280,10 @@ trait TypeOrBoundsOps extends Core {
220
280
internal.matchThisType(typeOrBounds).map(_.tref)
221
281
}
222
282
283
+ given (self : ThisType ) {
284
+ def tref (given ctx : Context ): Type = internal.ThisType_tref (self)
285
+ }
286
+
223
287
object IsRecursiveThis {
224
288
/** Matches any RecursiveThis and returns it */
225
289
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [RecursiveThis ] =
@@ -231,6 +295,10 @@ trait TypeOrBoundsOps extends Core {
231
295
internal.matchRecursiveThis(typeOrBounds).map(_.binder)
232
296
}
233
297
298
+ given (self : RecursiveThis ) {
299
+ def binder (given ctx : Context ): RecursiveType = internal.RecursiveThis_binder (self)
300
+ }
301
+
234
302
object IsRecursiveType {
235
303
/** Matches any RecursiveType and returns it */
236
304
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [RecursiveType ] =
@@ -242,6 +310,10 @@ trait TypeOrBoundsOps extends Core {
242
310
internal.matchRecursiveType(typeOrBounds).map(_.underlying)
243
311
}
244
312
313
+ given (self : RecursiveType ) {
314
+ def underlying (given ctx : Context ): Type = internal.RecursiveType_underlying (self)
315
+ }
316
+
245
317
object IsMethodType {
246
318
/** Matches any MethodType and returns it */
247
319
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [MethodType ] =
@@ -253,6 +325,14 @@ trait TypeOrBoundsOps extends Core {
253
325
internal.matchMethodType(typeOrBounds).map(x => (x.paramNames, x.paramTypes, x.resType))
254
326
}
255
327
328
+ given (self : MethodType ) {
329
+ def isImplicit : Boolean = internal.MethodType_isImplicit (self)
330
+ def isErased : Boolean = internal.MethodType_isErased (self)
331
+ def paramNames (given ctx : Context ): List [String ] = internal.MethodType_paramNames (self)
332
+ def paramTypes (given ctx : Context ): List [Type ] = internal.MethodType_paramTypes (self)
333
+ def resType (given ctx : Context ): Type = internal.MethodType_resType (self)
334
+ }
335
+
256
336
object IsPolyType {
257
337
/** Matches any PolyType and returns it */
258
338
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [PolyType ] =
@@ -264,6 +344,12 @@ trait TypeOrBoundsOps extends Core {
264
344
internal.matchPolyType(typeOrBounds).map(x => (x.paramNames, x.paramBounds, x.resType))
265
345
}
266
346
347
+ given (self : PolyType ) {
348
+ def paramNames (given ctx : Context ): List [String ] = internal.PolyType_paramNames (self)
349
+ def paramBounds (given ctx : Context ): List [TypeBounds ] = internal.PolyType_paramBounds (self)
350
+ def resType (given ctx : Context ): Type = internal.PolyType_resType (self)
351
+ }
352
+
267
353
object IsTypeLambda {
268
354
/** Matches any TypeLambda and returns it */
269
355
def unapply (tpe : TypeOrBounds )(given ctx : Context ): Option [TypeLambda ] =
@@ -275,92 +361,6 @@ trait TypeOrBoundsOps extends Core {
275
361
internal.matchTypeLambda(typeOrBounds).map(x => (x.paramNames, x.paramBounds, x.resType))
276
362
}
277
363
278
- given (self : ConstantType ) {
279
- def constant (given ctx : Context ): Constant = internal.ConstantType_constant (self)
280
- }
281
-
282
- given (self : TermRef ) {
283
- def qualifier (given ctx : Context ): TypeOrBounds /* Type | NoPrefix */ = internal.TermRef_qualifier (self)
284
- def name (given ctx : Context ): String = internal.TermRef_name (self)
285
- }
286
-
287
- given (self : TypeRef ) {
288
- def qualifier (given ctx : Context ): TypeOrBounds /* Type | NoPrefix */ = internal.TypeRef_qualifier (self)
289
- def name (given ctx : Context ): String = internal.TypeRef_name (self)
290
- }
291
-
292
- given (self : SuperType ) {
293
- def thistpe (given ctx : Context ): Type = internal.SuperType_thistpe (self)
294
- def supertpe (given ctx : Context ): Type = internal.SuperType_supertpe (self)
295
- }
296
-
297
- given (self : Refinement ) {
298
- def parent (given ctx : Context ): Type = internal.Refinement_parent (self)
299
- def name (given ctx : Context ): String = internal.Refinement_name (self)
300
- def info (given ctx : Context ): TypeOrBounds = internal.Refinement_info (self)
301
- }
302
-
303
- given (self : AppliedType ) {
304
- def tycon (given ctx : Context ): Type = internal.AppliedType_tycon (self)
305
- def args (given ctx : Context ): List [TypeOrBounds /* Type | TypeBounds */ ] = internal.AppliedType_args (self)
306
- }
307
-
308
- given (self : AnnotatedType ) {
309
- def underlying (given ctx : Context ): Type = internal.AnnotatedType_underlying (self)
310
- def annot (given ctx : Context ): Term = internal.AnnotatedType_annot (self)
311
- }
312
-
313
- given (self : AndType ) {
314
- def left (given ctx : Context ): Type = internal.AndType_left (self)
315
- def right (given ctx : Context ): Type = internal.AndType_right (self)
316
- }
317
-
318
- given (self : OrType ) {
319
- def left (given ctx : Context ): Type = internal.OrType_left (self)
320
- def right (given ctx : Context ): Type = internal.OrType_right (self)
321
- }
322
-
323
- given (self : MatchType ) {
324
- def bound (given ctx : Context ): Type = internal.MatchType_bound (self)
325
- def scrutinee (given ctx : Context ): Type = internal.MatchType_scrutinee (self)
326
- def cases (given ctx : Context ): List [Type ] = internal.MatchType_cases (self)
327
- }
328
-
329
- given (self : ByNameType ) {
330
- def underlying (given ctx : Context ): Type = internal.ByNameType_underlying (self)
331
- }
332
-
333
- given (self : ParamRef ) {
334
- def binder (given ctx : Context ): LambdaType [TypeOrBounds ] = internal.ParamRef_binder (self)
335
- def paramNum (given ctx : Context ): Int = internal.ParamRef_paramNum (self)
336
- }
337
-
338
- given (self : ThisType ) {
339
- def tref (given ctx : Context ): Type = internal.ThisType_tref (self)
340
- }
341
-
342
- given (self : RecursiveThis ) {
343
- def binder (given ctx : Context ): RecursiveType = internal.RecursiveThis_binder (self)
344
- }
345
-
346
- given (self : RecursiveType ) {
347
- def underlying (given ctx : Context ): Type = internal.RecursiveType_underlying (self)
348
- }
349
-
350
- given (self : MethodType ) {
351
- def isImplicit : Boolean = internal.MethodType_isImplicit (self)
352
- def isErased : Boolean = internal.MethodType_isErased (self)
353
- def paramNames (given ctx : Context ): List [String ] = internal.MethodType_paramNames (self)
354
- def paramTypes (given ctx : Context ): List [Type ] = internal.MethodType_paramTypes (self)
355
- def resType (given ctx : Context ): Type = internal.MethodType_resType (self)
356
- }
357
-
358
- given (self : PolyType ) {
359
- def paramNames (given ctx : Context ): List [String ] = internal.PolyType_paramNames (self)
360
- def paramBounds (given ctx : Context ): List [TypeBounds ] = internal.PolyType_paramBounds (self)
361
- def resType (given ctx : Context ): Type = internal.PolyType_resType (self)
362
- }
363
-
364
364
given (self : TypeLambda ) {
365
365
def paramNames (given ctx : Context ): List [String ] = internal.TypeLambda_paramNames (self)
366
366
def paramBounds (given ctx : Context ): List [TypeBounds ] = internal.TypeLambda_paramBounds (self)
0 commit comments