@@ -1226,14 +1226,14 @@ trait Applications extends Compatibility {
1226
1226
}
1227
1227
val dummyArg = dummyTreeOfType(ownType)
1228
1228
val unapplyApp = typedExpr(untpd.TypedSplice (Apply (unapplyFn, dummyArg :: Nil )))
1229
- def unapplyImplicits (unapp : Tree ): List [List [ Tree ] ] = {
1230
- val res = List .newBuilder[List [ Tree ] ]
1229
+ def unapplyImplicits (unapp : Tree ): List [Tree ] = {
1230
+ val res = List .newBuilder[Tree ]
1231
1231
def loop (unapp : Tree ): Unit = unapp match {
1232
- case Apply (Apply (unapply, `dummyArg` :: Nil ), args2) => assert(args2.nonEmpty); res += args2
1232
+ case Apply (Apply (unapply, `dummyArg` :: Nil ), args2) => assert(args2.nonEmpty); res ++ = args2
1233
1233
case Apply (unapply, `dummyArg` :: Nil ) =>
1234
1234
case Inlined (u, _, _) => loop(u)
1235
1235
case DynamicUnapply (_) => ctx.error(" Structural unapply is not supported" , unapplyFn.sourcePos)
1236
- case Apply (fn, args) => assert(args.nonEmpty); loop(fn); res += args
1236
+ case Apply (fn, args) => assert(args.nonEmpty); loop(fn); res ++ = args
1237
1237
case _ => ().assertingErrorsReported
1238
1238
}
1239
1239
loop(unapp)
@@ -1254,7 +1254,7 @@ trait Applications extends Compatibility {
1254
1254
List .fill(argTypes.length - args.length)(WildcardType )
1255
1255
}
1256
1256
val unapplyPatterns = bunchedArgs.lazyZip(argTypes) map (typed(_, _))
1257
- val result = assignType(cpy.UnApply (tree)(unapplyFn, unapplyImplicits(unapplyApp).flatten , unapplyPatterns), ownType)
1257
+ val result = assignType(cpy.UnApply (tree)(unapplyFn, unapplyImplicits(unapplyApp), unapplyPatterns), ownType)
1258
1258
unapp.println(s " unapply patterns = $unapplyPatterns" )
1259
1259
if ((ownType eq selType) || ownType.isError) result
1260
1260
else tryWithClassTag(Typed (result, TypeTree (ownType)), selType)
0 commit comments