@@ -3185,6 +3185,12 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
31853185 /** Methods of the module object `val MethodType` */
31863186 trait MethodTypeModule { this : MethodType .type =>
31873187 def apply (paramNames : List [String ])(paramInfosExp : MethodType => List [TypeRepr ], resultTypeExp : MethodType => TypeRepr ): MethodType
3188+ /** Companion for method type without implicit nor contextual parameter */
3189+ def Plain : MethodTypeCompanion
3190+ /** Companion for method type with contextual parameter */
3191+ def Contextual : MethodTypeCompanion
3192+ /** Companion for method type with implicit parameter */
3193+ def Implicit : MethodTypeCompanion
31883194 def unapply (x : MethodType ): (List [String ], List [TypeRepr ], TypeRepr )
31893195 }
31903196
@@ -3194,8 +3200,12 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
31943200 /** Extension methods of `MethodType` */
31953201 trait MethodTypeMethods :
31963202 extension (self : MethodType )
3203+ /** Is this the type of using parameter clause `(using X1, ..., Xn)` or `(using x1: X1, ..., xn: Xn)` */
3204+ def isContextual : Boolean
31973205 /** Is this the type of using parameter clause `(implicit X1, ..., Xn)`, `(using X1, ..., Xn)` or `(using x1: X1, ..., xn: Xn)` */
31983206 def isImplicit : Boolean
3207+ /** Companion of this method type. Can be used to construct method types with the same implicitness of parameters */
3208+ def companion : MethodTypeCompanion
31993209 /** Is this the type of erased parameter clause `(erased x1: X1, ..., xn: Xn)` */
32003210 // TODO:deprecate in 3.4 and stabilize `erasedParams` and `hasErasedParams`.
32013211 // @deprecated("Use `hasErasedParams`","3.4")
@@ -3211,6 +3221,14 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
32113221 end extension
32123222 end MethodTypeMethods
32133223
3224+ /** Companion of a method type. It provides a way to instantiate new method types with a given implicitness of arguments. */
3225+ type MethodTypeCompanion
3226+
3227+ trait MethodTypeCompanionMethods {
3228+ /** Create a MethodType with the same implicitness as this companion */
3229+ def apply (paramNames : List [String ])(paramInfosExp : MethodType => List [TypeRepr ], resultTypeExp : MethodType => TypeRepr ): MethodType
3230+ }
3231+
32143232 /** Type of the definition of a method taking a list of type parameters. It's return type may be a MethodType. */
32153233 type PolyType <: MethodOrPoly
32163234
0 commit comments