@@ -31,13 +31,13 @@ object GenericSignatures {
31
31
* @param info The type of the symbol
32
32
* @return The signature if it could be generated, `None` otherwise.
33
33
*/
34
- def javaSig (sym0 : Symbol , info : Type )(implicit ctx : Context ): Option [String ] =
34
+ def javaSig (sym0 : Symbol , info : Type )(using Context ): Option [String ] =
35
35
// Avoid generating a signature for local symbols.
36
36
if (sym0.isLocal) None
37
37
else javaSig0(sym0, info)(using ctx.withPhase(ctx.erasurePhase))
38
38
39
39
@ noinline
40
- private final def javaSig0 (sym0 : Symbol , info : Type )(implicit ctx : Context ): Option [String ] = {
40
+ private final def javaSig0 (sym0 : Symbol , info : Type )(using Context ): Option [String ] = {
41
41
val builder = new StringBuilder (64 )
42
42
val isTraitSignature = sym0.enclosingClass.is(Trait )
43
43
@@ -247,7 +247,7 @@ object GenericSignatures {
247
247
248
248
case mtpe : MethodType =>
249
249
// erased method parameters do not make it to the bytecode.
250
- def effectiveParamInfoss (t : Type )(implicit ctx : Context ): List [List [Type ]] = t match {
250
+ def effectiveParamInfoss (t : Type )(using Context ): List [List [Type ]] = t match {
251
251
case t : MethodType if t.isErasedMethod => effectiveParamInfoss(t.resType)
252
252
case t : MethodType => t.paramInfos :: effectiveParamInfoss(t.resType)
253
253
case _ => Nil
@@ -319,7 +319,7 @@ object GenericSignatures {
319
319
* not Object, the dominator is Tc. <--- @PP: "which is not Object" not in spec.
320
320
* - Otherwise, the dominator is the first element of the span.
321
321
*/
322
- private def intersectionDominator (parents : List [Type ])(implicit ctx : Context ): Type =
322
+ private def intersectionDominator (parents : List [Type ])(using Context ): Type =
323
323
if (parents.isEmpty) defn.ObjectType
324
324
else {
325
325
val psyms = parents map (_.typeSymbol)
@@ -342,7 +342,7 @@ object GenericSignatures {
342
342
/* Drop redundant types (ones which are implemented by some other parent) from the immediate parents.
343
343
* This is important on Android because there is otherwise an interface explosion.
344
344
*/
345
- private def minimizeParents (cls : Symbol , parents : List [Type ])(implicit ctx : Context ): List [Type ] = if (parents.isEmpty) parents else {
345
+ private def minimizeParents (cls : Symbol , parents : List [Type ])(using Context ): List [Type ] = if (parents.isEmpty) parents else {
346
346
// val requiredDirect: Symbol => Boolean = requiredDirectInterfaces.getOrElse(cls, Set.empty)
347
347
var rest = parents.tail
348
348
var leaves = collection.mutable.ListBuffer .empty[Type ] += parents.head
@@ -364,7 +364,7 @@ object GenericSignatures {
364
364
leaves.toList
365
365
}
366
366
367
- private def hiBounds (bounds : TypeBounds )(implicit ctx : Context ): List [Type ] = bounds.hi.widenDealias match {
367
+ private def hiBounds (bounds : TypeBounds )(using Context ): List [Type ] = bounds.hi.widenDealias match {
368
368
case AndType (tp1, tp2) => hiBounds(tp1.bounds) ::: hiBounds(tp2.bounds)
369
369
case tp => tp :: Nil
370
370
}
@@ -374,7 +374,7 @@ object GenericSignatures {
374
374
// * higher-order type parameters
375
375
// * type parameters appearing in method parameters
376
376
// * type members not visible in an enclosing template
377
- private def isTypeParameterInSig (sym : Symbol , initialSymbol : Symbol )(implicit ctx : Context ) =
377
+ private def isTypeParameterInSig (sym : Symbol , initialSymbol : Symbol )(using Context ) =
378
378
! sym.maybeOwner.isTypeParam &&
379
379
sym.isTypeParam && (
380
380
sym.isContainedIn(initialSymbol.topLevelClass) ||
@@ -390,13 +390,13 @@ object GenericSignatures {
390
390
// included (use pre.baseType(cls.owner)).
391
391
//
392
392
// This requires that cls.isClass.
393
- private def rebindInnerClass (pre : Type , cls : Symbol )(implicit ctx : Context ): Type = {
393
+ private def rebindInnerClass (pre : Type , cls : Symbol )(using Context ): Type = {
394
394
val owner = cls.owner
395
395
if (owner.is(PackageClass ) || owner.isTerm) pre else cls.owner.info /* .tpe_* */
396
396
}
397
397
398
398
private object RefOrAppliedType {
399
- def unapply (tp : Type )(implicit ctx : Context ): Option [(Symbol , Type , List [Type ])] = tp match {
399
+ def unapply (tp : Type )(using Context ): Option [(Symbol , Type , List [Type ])] = tp match {
400
400
case TypeParamRef (_, _) =>
401
401
Some ((tp.typeSymbol, tp, Nil ))
402
402
case TermParamRef (_, _) =>
@@ -411,12 +411,12 @@ object GenericSignatures {
411
411
}
412
412
}
413
413
414
- private def needsJavaSig (tp : Type , throwsArgs : List [Type ])(implicit ctx : Context ): Boolean = ! ctx.settings.YnoGenericSig .value && {
414
+ private def needsJavaSig (tp : Type , throwsArgs : List [Type ])(using Context ): Boolean = ! ctx.settings.YnoGenericSig .value && {
415
415
def needs (tp : Type ) = (new NeedsSigCollector ).apply(false , tp)
416
416
needs(tp) || throwsArgs.exists(needs)
417
417
}
418
418
419
- private class NeedsSigCollector (implicit ctx : Context ) extends TypeAccumulator [Boolean ] {
419
+ private class NeedsSigCollector (using Context ) extends TypeAccumulator [Boolean ] {
420
420
override def apply (x : Boolean , tp : Type ): Boolean =
421
421
if (! x)
422
422
tp match {
0 commit comments