File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -4157,6 +4157,7 @@ SolutionApplicationTarget::SolutionApplicationTarget(
4157
4157
expression.convertType = convertType;
4158
4158
expression.pattern = nullptr ;
4159
4159
expression.wrappedVar = nullptr ;
4160
+ expression.innermostWrappedValueInit = nullptr ;
4160
4161
expression.isDiscarded = isDiscarded;
4161
4162
expression.bindPatternVarsOneWay = false ;
4162
4163
expression.patternBinding = nullptr ;
Original file line number Diff line number Diff line change @@ -1202,6 +1202,10 @@ class SolutionApplicationTarget {
1202
1202
// / this is an initialization involving a property wrapper.
1203
1203
VarDecl *wrappedVar;
1204
1204
1205
+ // / The innermost call to \c init(wrappedValue:), if this is an
1206
+ // / initialization involving a property wrapper.
1207
+ ApplyExpr *innermostWrappedValueInit;
1208
+
1205
1209
// / Whether the expression result will be discarded at the end.
1206
1210
bool isDiscarded;
1207
1211
@@ -1384,6 +1388,20 @@ class SolutionApplicationTarget {
1384
1388
expression.bindPatternVarsOneWay ;
1385
1389
}
1386
1390
1391
+ // / Whether or not an opaque value placeholder should be injected into the
1392
+ // / first \c wrappedValue argument of an apply expression.
1393
+ bool shouldInjectWrappedValuePlaceholder (ApplyExpr *apply) const {
1394
+ if (kind != Kind::expression ||
1395
+ expression.contextualPurpose != CTP_Initialization)
1396
+ return false ;
1397
+
1398
+ auto *wrappedVar = expression.wrappedVar ;
1399
+ if (!wrappedVar || wrappedVar->isStatic ())
1400
+ return false ;
1401
+
1402
+ return expression.innermostWrappedValueInit == apply;
1403
+ }
1404
+
1387
1405
// / Retrieve the wrapped variable when initializing a pattern with a
1388
1406
// / property wrapper.
1389
1407
VarDecl *getInitializationWrappedVar () const {
You can’t perform that action at this time.
0 commit comments