@@ -234,6 +234,7 @@ object GenericSignatures {
234234
235235 @ noinline
236236 def jsig (tp0 : Type , toplevel : Boolean = false , unboxedVCs : Boolean = true ): Unit = {
237+ inline def jsig1 (tp0 : Type ): Unit = jsig(tp0, toplevel = false , unboxedVCs = true )
237238
238239 val tp = tp0.dealias
239240 tp match {
@@ -242,41 +243,41 @@ object GenericSignatures {
242243 val erasedUnderlying = fullErasure(ref.underlying.bounds.hi)
243244 // don't emit type param name if the param is upper-bounded by a primitive type (including via a value class)
244245 if erasedUnderlying.isPrimitiveValueType then
245- jsig(erasedUnderlying, toplevel, unboxedVCs)
246+ jsig(erasedUnderlying, toplevel = toplevel, unboxedVCs = unboxedVCs)
246247 else typeParamSig(ref.paramName.lastPart)
247248
248249 case defn.ArrayOf (elemtp) =>
249250 if (isGenericArrayElement(elemtp, isScala2 = false ))
250- jsig (defn.ObjectType )
251+ jsig1 (defn.ObjectType )
251252 else
252253 builder.append(ClassfileConstants .ARRAY_TAG )
253254 elemtp match
254- case TypeBounds (lo, hi) => jsig (hi.widenDealias)
255- case _ => jsig (elemtp)
255+ case TypeBounds (lo, hi) => jsig1 (hi.widenDealias)
256+ case _ => jsig1 (elemtp)
256257
257258 case RefOrAppliedType (sym, pre, args) =>
258259 if (sym == defn.PairClass && tupleArity(tp) > Definitions .MaxTupleArity )
259- jsig (defn.TupleXXLClass .typeRef)
260+ jsig1 (defn.TupleXXLClass .typeRef)
260261 else if (isTypeParameterInSig(sym, sym0)) {
261262 assert(! sym.isAliasType || sym.info.isLambdaSub, " Unexpected alias type: " + sym)
262263 typeParamSig(sym.name.lastPart)
263264 }
264265 else if (defn.specialErasure.contains(sym))
265- jsig (defn.specialErasure(sym).typeRef)
266+ jsig1 (defn.specialErasure(sym).typeRef)
266267 else if (sym == defn.UnitClass || sym == defn.BoxedUnitModule )
267- jsig (defn.BoxedUnitClass .typeRef)
268+ jsig1 (defn.BoxedUnitClass .typeRef)
268269 else if (sym == defn.NothingClass )
269270 builder.append(" Lscala/runtime/Nothing$;" )
270271 else if (sym == defn.NullClass )
271272 builder.append(" Lscala/runtime/Null$;" )
272273 else if (sym.isPrimitiveValueClass)
273- if (! unboxedVCs) jsig (defn.ObjectType )
274- else if (sym == defn.UnitClass ) jsig (defn.BoxedUnitClass .typeRef)
274+ if (! unboxedVCs) jsig1 (defn.ObjectType )
275+ else if (sym == defn.UnitClass ) jsig1 (defn.BoxedUnitClass .typeRef)
275276 else builder.append(defn.typeTag(sym.info))
276277 else if (sym.isDerivedValueClass) {
277278 if (unboxedVCs) {
278279 val erasedUnderlying = fullErasure(tp)
279- jsig(erasedUnderlying, toplevel)
280+ jsig(erasedUnderlying, toplevel = toplevel, unboxedVCs = true )
280281 } else classSig(sym, pre, args)
281282 }
282283 else if (defn.isSyntheticFunctionClass(sym)) {
@@ -286,20 +287,20 @@ object GenericSignatures {
286287 else if sym.isClass then
287288 classSig(sym, pre, args)
288289 else
289- jsig(erasure(tp), toplevel, unboxedVCs)
290+ jsig(erasure(tp), toplevel = toplevel, unboxedVCs = unboxedVCs)
290291
291292 case ExprType (restpe) if toplevel =>
292293 builder.append(" ()" )
293294 methodResultSig(restpe)
294295
295296 case ExprType (restpe) =>
296- jsig (defn.FunctionType (0 ).appliedTo(restpe))
297+ jsig1 (defn.FunctionType (0 ).appliedTo(restpe))
297298
298299 case mtd : MethodOrPoly =>
299300 val (tparams, vparams, rte) = collectMethodParams(mtd)
300301 if (toplevel && ! sym0.isConstructor) polyParamSig(tparams)
301302 builder.append('(' )
302- for vparam <- vparams do jsig (vparam)
303+ for vparam <- vparams do jsig1 (vparam)
303304 builder.append(')' )
304305 methodResultSig(rte)
305306
@@ -316,7 +317,7 @@ object GenericSignatures {
316317 val (reprParents, _) = splitIntersection(parents)
317318 val repr =
318319 reprParents.find(_.typeSymbol.is(TypeParam )).getOrElse(reprParents.head)
319- jsig(repr, unboxedVCs = unboxedVCs)
320+ jsig(repr, toplevel = false , unboxedVCs = unboxedVCs)
320321
321322 case ci : ClassInfo =>
322323 val tParams = tp.typeParams
0 commit comments