File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,20 @@ inline bool shouldExpandTupleType(TupleType *type) {
64
64
return false ;
65
65
}
66
66
67
+ // / A version of the above for parameter lists.
68
+ // /
69
+ // / FIXME: Should also remove this soon.
70
+ inline bool shouldExpandParams (AnyFunctionType::CanParamArrayRef params) {
71
+ for (auto param : params)
72
+ if (param.getValueOwnership () != ValueOwnership::Default)
73
+ return true ;
74
+
75
+ if (params.size () == 1 )
76
+ return params[0 ].isVariadic ();
77
+
78
+ return false ;
79
+ }
80
+
67
81
// / The default convention for handling the callee object on thick
68
82
// / callees.
69
83
const ParameterConvention DefaultThickCalleeConvention =
Original file line number Diff line number Diff line change @@ -608,13 +608,7 @@ class DestructureInputs {
608
608
// If the abstraction pattern is opaque and the parameter list is a valid
609
609
// target for substitution, implode it into a single tuple parameter.
610
610
if (!hasSelf) {
611
- bool canImplode = true ;
612
- for (auto param : params)
613
- canImplode &= (param.getValueOwnership () == ValueOwnership::Default);
614
- if (params.size () == 1 )
615
- canImplode &= !params[0 ].isVariadic ();
616
-
617
- if (canImplode && origType.isTypeParameter ()) {
611
+ if (origType.isTypeParameter () && !shouldExpandParams (params)) {
618
612
CanType ty = AnyFunctionType::composeInput (M.getASTContext (), params,
619
613
/* canonicalVararg*/ true )
620
614
->getCanonicalType ();
You can’t perform that action at this time.
0 commit comments