Skip to content

Commit 76272d3

Browse files
committed
Sema: simplify checking for a designated init in canSuppressPotentialWitnessWarningWithMovement
1 parent d022c4a commit 76272d3

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4351,17 +4351,8 @@ canSuppressPotentialWitnessWarningWithMovement(ValueDecl *requirement,
43514351
// If the witness is a designated or required initializer, we can't move it
43524352
// to an extension.
43534353
if (auto ctor = dyn_cast<ConstructorDecl>(witness)) {
4354-
switch (ctor->getInitKind()) {
4355-
case CtorInitializerKind::Designated:
4354+
if (ctor->isDesignatedInit() || ctor->isRequired())
43564355
return None;
4357-
4358-
case CtorInitializerKind::Convenience:
4359-
case CtorInitializerKind::ConvenienceFactory:
4360-
case CtorInitializerKind::Factory:
4361-
break;
4362-
}
4363-
4364-
if (ctor->isRequired()) return None;
43654356
}
43664357

43674358
// We can move this entity to an extension.

0 commit comments

Comments
 (0)