Skip to content

Commit 089b8b8

Browse files
authored
Merge pull request #66464 from xedin/init-accessor-memberwise-default-5.9
[5.9][Sema] InitAccessors: Don't synthesize default memberwise arg for ini…
2 parents 67cf190 + 00cbbe8 commit 089b8b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Sema/CodeSynthesis.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ static void maybeAddMemberwiseDefaultArg(ParamDecl *arg, VarDecl *var,
144144
if (!var->getParentPattern()->getSingleVar())
145145
return;
146146

147+
// FIXME: Don't attempt to synthesize default arguments for init
148+
// accessor properties because there could be multiple properties
149+
// with default values they are going to initialize.
150+
if (var->getAccessor(AccessorKind::Init))
151+
return;
152+
147153
// Whether we have explicit initialization.
148154
bool isExplicitlyInitialized = false;
149155
if (auto pbd = var->getParentPatternBinding()) {

0 commit comments

Comments
 (0)