@@ -103,6 +103,7 @@ trait TypeOrBoundsOps extends Core {
103
103
def unapply (x : ConstantType )(given ctx : Context ): Option [ConstantType ] = Some (x)
104
104
105
105
object ConstantType {
106
+ def apply (x : Constant )(given ctx : Context ): ConstantType = internal.ConstantType_apply (x)
106
107
def unapply (x : ConstantType )(given ctx : Context ): Option [Constant ] = Some (x.constant)
107
108
}
108
109
@@ -205,6 +206,8 @@ trait TypeOrBoundsOps extends Core {
205
206
def unapply (x : AnnotatedType )(given ctx : Context ): Option [AnnotatedType ] = Some (x)
206
207
207
208
object AnnotatedType {
209
+ def apply (underlying : Type , annot : Term )(given ctx : Context ): AnnotatedType =
210
+ internal.AnnotatedType_apply (underlying, annot)
208
211
def unapply (x : AnnotatedType )(given ctx : Context ): Option [(Type , Term )] =
209
212
Some ((x.underlying, x.annot))
210
213
}
@@ -221,6 +224,8 @@ trait TypeOrBoundsOps extends Core {
221
224
def unapply (x : AndType )(given ctx : Context ): Option [AndType ] = Some (x)
222
225
223
226
object AndType {
227
+ def apply (lhs : Type , rhs : Type )(given ctx : Context ): AndType =
228
+ internal.AndType_apply (lhs, rhs)
224
229
def unapply (x : AndType )(given ctx : Context ): Option [(Type , Type )] =
225
230
Some ((x.left, x.right))
226
231
}
@@ -237,6 +242,7 @@ trait TypeOrBoundsOps extends Core {
237
242
def unapply (x : OrType )(given ctx : Context ): Option [OrType ] = Some (x)
238
243
239
244
object OrType {
245
+ def apply (lhs : Type , rhs : Type )(given ctx : Context ): OrType = internal.OrType_apply (lhs, rhs)
240
246
def unapply (x : OrType )(given ctx : Context ): Option [(Type , Type )] =
241
247
Some ((x.left, x.right))
242
248
}
@@ -253,6 +259,8 @@ trait TypeOrBoundsOps extends Core {
253
259
def unapply (x : MatchType )(given ctx : Context ): Option [MatchType ] = Some (x)
254
260
255
261
object MatchType {
262
+ def apply (bound : Type , scrutinee : Type , cases : List [Type ])(given ctx : Context ): MatchType =
263
+ internal.MatchType_apply (bound, scrutinee, cases)
256
264
def unapply (x : MatchType )(given ctx : Context ): Option [(Type , Type , List [Type ])] =
257
265
Some ((x.bound, x.scrutinee, x.cases))
258
266
}
@@ -263,6 +271,14 @@ trait TypeOrBoundsOps extends Core {
263
271
def cases (given ctx : Context ): List [Type ] = internal.MatchType_cases (self)
264
272
}
265
273
274
+ /**
275
+ * An accessor for `scala.internal.MatchCase[_,_]`, the representation of a `MatchType` case.
276
+ */
277
+ def MatchCaseType (given Context ): Type = {
278
+ import scala .internal .MatchCase
279
+ Type (classOf [MatchCase [_,_]])
280
+ }
281
+
266
282
given (given Context ): IsInstanceOf [ByNameType ] = internal.isInstanceOfByNameType
267
283
268
284
object IsByNameType
@@ -381,13 +397,16 @@ trait TypeOrBoundsOps extends Core {
381
397
def unapply (x : TypeLambda )(given ctx : Context ): Option [TypeLambda ] = Some (x)
382
398
383
399
object TypeLambda {
400
+ def apply (paramNames : List [String ], boundsFn : TypeLambda => List [TypeBounds ], bodyFn : TypeLambda => Type ): TypeLambda =
401
+ internal.TypeLambda_apply (paramNames, boundsFn, bodyFn)
384
402
def unapply (x : TypeLambda )(given ctx : Context ): Option [(List [String ], List [TypeBounds ], Type )] =
385
403
Some ((x.paramNames, x.paramBounds, x.resType))
386
404
}
387
405
388
406
given TypeLambdaOps : extension (self : TypeLambda ) {
389
407
def paramNames (given ctx : Context ): List [String ] = internal.TypeLambda_paramNames (self)
390
408
def paramBounds (given ctx : Context ): List [TypeBounds ] = internal.TypeLambda_paramBounds (self)
409
+ def param (idx : Int )(given ctx : Context ) : Type = internal.TypeLambda_param (self, idx)
391
410
def resType (given ctx : Context ): Type = internal.TypeLambda_resType (self)
392
411
}
393
412
@@ -400,6 +419,8 @@ trait TypeOrBoundsOps extends Core {
400
419
def unapply (x : TypeBounds )(given ctx : Context ): Option [TypeBounds ] = Some (x)
401
420
402
421
object TypeBounds {
422
+ def apply (low : Type , hi : Type )(given ctx : Context ): TypeBounds =
423
+ internal.TypeBounds_apply (low, hi)
403
424
def unapply (x : TypeBounds )(given ctx : Context ): Option [(Type , Type )] = Some ((x.low, x.hi))
404
425
}
405
426
0 commit comments