Skip to content

Commit 6fbd619

Browse files
committed
Remove Swift 3 default argument behavior
1 parent 38ccddd commit 6fbd619

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

lib/SIL/SILDeclRef.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,8 @@ SubclassScope SILDeclRef::getSubclassScope() const {
887887
if (isThunk() || isForeign)
888888
return SubclassScope::NotApplicable;
889889

890-
// Default arg generators only need to be visible in Swift 3.
891-
if (isDefaultArgGenerator() && !context->getASTContext().isSwiftVersion3())
890+
// Default arg generators are not visible.
891+
if (isDefaultArgGenerator())
892892
return SubclassScope::NotApplicable;
893893

894894
auto *classType = context->getSelfClassDecl();

lib/Sema/TypeCheckStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ void TypeChecker::checkDefaultArguments(ParameterList *params,
14951495
// caller.
14961496
if (auto *func = dyn_cast<AbstractFunctionDecl>(VD)) {
14971497
auto expansion = func->getResilienceExpansion();
1498-
if (!Context.isSwiftVersion3() && access.isPublic())
1498+
if (access.isPublic())
14991499
expansion = ResilienceExpansion::Minimal;
15001500

15011501
func->setDefaultArgumentResilienceExpansion(expansion);

lib/TBDGen/TBDGen.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ void TBDGenVisitor::visitAbstractFunctionDecl(AbstractFunctionDecl *AFD) {
170170
addSymbol(SILDeclRef(AFD).asForeign());
171171
}
172172

173-
auto publicDefaultArgGenerators =
174-
SwiftModule->getASTContext().isSwiftVersion3() ||
175-
SwiftModule->isTestingEnabled();
173+
auto publicDefaultArgGenerators = SwiftModule->isTestingEnabled();
176174
if (!publicDefaultArgGenerators)
177175
return;
178176

0 commit comments

Comments
 (0)