@@ -233,6 +233,7 @@ object GenericSignatures {
233
233
234
234
@ noinline
235
235
def jsig (tp0 : Type , toplevel : Boolean = false , unboxedVCs : Boolean = true ): Unit = {
236
+ inline def jsig1 (tp0 : Type ): Unit = jsig(tp0, toplevel = false , unboxedVCs = true )
236
237
237
238
val tp = tp0.dealias
238
239
tp match {
@@ -241,41 +242,41 @@ object GenericSignatures {
241
242
val erasedUnderlying = fullErasure(ref.underlying.bounds.hi)
242
243
// don't emit type param name if the param is upper-bounded by a primitive type (including via a value class)
243
244
if erasedUnderlying.isPrimitiveValueType then
244
- jsig(erasedUnderlying, toplevel, unboxedVCs)
245
+ jsig(erasedUnderlying, toplevel = toplevel, unboxedVCs = unboxedVCs)
245
246
else typeParamSig(ref.paramName.lastPart)
246
247
247
248
case defn.ArrayOf (elemtp) =>
248
249
if (isGenericArrayElement(elemtp, isScala2 = false ))
249
- jsig (defn.ObjectType )
250
+ jsig1 (defn.ObjectType )
250
251
else
251
252
builder.append(ClassfileConstants .ARRAY_TAG )
252
253
elemtp match
253
- case TypeBounds (lo, hi) => jsig (hi.widenDealias)
254
- case _ => jsig (elemtp)
254
+ case TypeBounds (lo, hi) => jsig1 (hi.widenDealias)
255
+ case _ => jsig1 (elemtp)
255
256
256
257
case RefOrAppliedType (sym, pre, args) =>
257
258
if (sym == defn.PairClass && tupleArity(tp) > Definitions .MaxTupleArity )
258
- jsig (defn.TupleXXLClass .typeRef)
259
+ jsig1 (defn.TupleXXLClass .typeRef)
259
260
else if (isTypeParameterInSig(sym, sym0)) {
260
261
assert(! sym.isAliasType, " Unexpected alias type: " + sym)
261
262
typeParamSig(sym.name.lastPart)
262
263
}
263
264
else if (defn.specialErasure.contains(sym))
264
- jsig (defn.specialErasure(sym).nn.typeRef)
265
+ jsig1 (defn.specialErasure(sym).nn.typeRef)
265
266
else if (sym == defn.UnitClass || sym == defn.BoxedUnitModule )
266
- jsig (defn.BoxedUnitClass .typeRef)
267
+ jsig1 (defn.BoxedUnitClass .typeRef)
267
268
else if (sym == defn.NothingClass )
268
269
builder.append(" Lscala/runtime/Nothing$;" )
269
270
else if (sym == defn.NullClass )
270
271
builder.append(" Lscala/runtime/Null$;" )
271
272
else if (sym.isPrimitiveValueClass)
272
- if (! unboxedVCs) jsig (defn.ObjectType )
273
- else if (sym == defn.UnitClass ) jsig (defn.BoxedUnitClass .typeRef)
273
+ if (! unboxedVCs) jsig1 (defn.ObjectType )
274
+ else if (sym == defn.UnitClass ) jsig1 (defn.BoxedUnitClass .typeRef)
274
275
else builder.append(defn.typeTag(sym.info))
275
276
else if (sym.isDerivedValueClass) {
276
277
if (unboxedVCs) {
277
278
val erasedUnderlying = fullErasure(tp)
278
- jsig(erasedUnderlying, toplevel)
279
+ jsig(erasedUnderlying, toplevel = toplevel, unboxedVCs = true )
279
280
} else classSig(sym, pre, args)
280
281
}
281
282
else if (defn.isSyntheticFunctionClass(sym)) {
@@ -285,14 +286,14 @@ object GenericSignatures {
285
286
else if sym.isClass then
286
287
classSig(sym, pre, args)
287
288
else
288
- jsig(erasure(tp), toplevel, unboxedVCs)
289
+ jsig(erasure(tp), toplevel = toplevel, unboxedVCs = unboxedVCs)
289
290
290
291
case ExprType (restpe) if toplevel =>
291
292
builder.append(" ()" )
292
293
methodResultSig(restpe)
293
294
294
295
case ExprType (restpe) =>
295
- jsig (defn.FunctionType (0 ).appliedTo(restpe))
296
+ jsig1 (defn.FunctionType (0 ).appliedTo(restpe))
296
297
297
298
case PolyType (tparams, mtpe : MethodType ) =>
298
299
assert(tparams.nonEmpty)
@@ -320,7 +321,7 @@ object GenericSignatures {
320
321
builder.append('(' )
321
322
// TODO: Update once we support varargs
322
323
params.foreach { tp =>
323
- jsig (tp)
324
+ jsig1 (tp)
324
325
}
325
326
builder.append(')' )
326
327
methodResultSig(restpe)
@@ -338,7 +339,7 @@ object GenericSignatures {
338
339
val (reprParents, _) = splitIntersection(parents)
339
340
val repr =
340
341
reprParents.find(_.typeSymbol.is(TypeParam )).getOrElse(reprParents.head)
341
- jsig(repr, unboxedVCs = unboxedVCs)
342
+ jsig(repr, toplevel = false , unboxedVCs = unboxedVCs)
342
343
343
344
case ci : ClassInfo =>
344
345
val tParams = tp.typeParams
0 commit comments