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