@@ -350,7 +350,7 @@ class TreeUnpickler(reader: TastyReader,
350
350
case binder : LambdaType => binder.paramRefs(readNat())
351
351
}
352
352
case HOLE =>
353
- readHole(end, isType = true ).tpe
353
+ readHole(end).tpe
354
354
}
355
355
assert(currentAddr == end, s " $start $currentAddr $end ${astTagToString(tag)}" )
356
356
result
@@ -1148,7 +1148,7 @@ class TreeUnpickler(reader: TastyReader,
1148
1148
val hi = if (currentAddr == end) lo else readTpt()
1149
1149
TypeBoundsTree (lo, hi)
1150
1150
case HOLE =>
1151
- readHole(end, isType = false )
1151
+ readHole(end)
1152
1152
case UNTYPEDSPLICE =>
1153
1153
tpd.UntypedSplice (readUntyped()).withType(readType())
1154
1154
case _ =>
@@ -1204,20 +1204,17 @@ class TreeUnpickler(reader: TastyReader,
1204
1204
owner => new LazyReader (localReader, owner, ctx.mode, op)
1205
1205
}
1206
1206
1207
- def readHole (end : Addr , isType : Boolean )(implicit ctx : Context ): Tree = {
1207
+ def readHole (end : Addr )(implicit ctx : Context ): Tree = {
1208
1208
val idx = readNat()
1209
1209
val args = until(end)(readTerm())
1210
1210
val splice = splices(idx)
1211
1211
def wrap (arg : Tree ) =
1212
1212
if (arg.isTerm) new TastyTreeExpr (arg)
1213
1213
else new TreeType (arg)
1214
1214
val reifiedArgs = args.map(wrap)
1215
- if (isType) {
1216
- val quotedType = splice.asInstanceOf [Seq [Any ] => quoted.Type [_]](reifiedArgs)
1217
- PickledQuotes .quotedTypeToTree(quotedType)
1218
- } else {
1219
- val quotedExpr = splice.asInstanceOf [Seq [Any ] => quoted.Expr [_]](reifiedArgs)
1220
- PickledQuotes .quotedExprToTree(quotedExpr)
1215
+ splice.asInstanceOf [Seq [Any ] => Any ](reifiedArgs) match {
1216
+ case spliced : quoted.Type [_] => PickledQuotes .quotedTypeToTree(spliced)
1217
+ case spliced : quoted.Expr [_] => PickledQuotes .quotedExprToTree(spliced)
1221
1218
}
1222
1219
}
1223
1220
// ------ Reading untyped trees --------------------------------------------
0 commit comments