@@ -1233,25 +1233,27 @@ class TreeUnpickler(reader: TastyReader,
1233
1233
val fn = readTerm()
1234
1234
val args = until(end)(readTerm())
1235
1235
if fn.symbol.isConstructor then constructorApply(fn, args)
1236
- else if defn.isPolymorphicSignature(fn.symbol) then
1237
- val info = MethodType (args.map(_.tpe.widen), defn.ObjectType )
1238
- val fun2 = fn.withType(fn.symbol.copy(info = info).termRef)
1239
- tpd.Apply (fun2, args)
1240
- else
1241
- tpd.Apply (fn, args)
1236
+ else tpd.Apply (fn, args)
1242
1237
case TYPEAPPLY =>
1243
1238
tpd.TypeApply (readTerm(), until(end)(readTpt()))
1244
1239
case TYPED =>
1245
- val expr = readTerm()
1246
- val tpt = readTpt()
1247
- expr match
1248
- case Apply (fun, args) if defn.wasPolymorphicSignature(fun.symbol) =>
1240
+ val rdr = fork
1241
+ val start = rdr.reader.currentAddr
1242
+ if rdr.reader.readByte() == APPLY then
1243
+ val end = rdr.reader.readEnd()
1244
+ val fn = rdr.readTerm()
1245
+ if defn.isPolymorphicSignature(fn.symbol) then
1246
+ skipTree() // expr
1247
+ skipTree() // tpt
1248
+ val args = rdr.reader.until(end)(rdr.readTerm())
1249
+ val tpt = rdr.readTpt()
1249
1250
val info = MethodType (args.map(_.tpe.widen), tpt.tpe)
1250
- val fun2 = fun.withType(fun.symbol.copy(info = info).termRef)
1251
- val expr2 = tpd.cpy.Apply (expr)(fun2, args)
1252
- Typed (expr2, tpt)
1253
- case _ =>
1254
- Typed (expr, tpt)
1251
+ val fun2 = fn.withType(fn.symbol.copy(info = info).termRef)
1252
+ val app = Apply (fun2, args)
1253
+ rdr.setSpan(start, app)
1254
+ Typed (app, tpt)
1255
+ else Typed (readTerm(), readTpt())
1256
+ else Typed (readTerm(), readTpt())
1255
1257
case ASSIGN =>
1256
1258
Assign (readTerm(), readTerm())
1257
1259
case BLOCK =>
0 commit comments