Skip to content

Commit f1d2db5

Browse files
committed
ASTScope: ParameterListScope does not change the insertion point
1 parent fd53040 commit f1d2db5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

include/swift/AST/ASTScope.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,7 @@ class ParameterListScope final : public ASTScopeImpl {
910910
ASTScopeImpl *expandSpecifically(ScopeCreator &scopeCreator) override;
911911

912912
private:
913-
AnnotatedInsertionPoint
914-
expandAScopeThatCreatesANewInsertionPoint(ScopeCreator &);
913+
void expandAScopeThatDoesNotCreateANewInsertionPoint(ScopeCreator &);
915914
SourceLoc fixupEndForBadInput(SourceRange) const;
916915

917916
public:

lib/AST/ASTScopeCreation.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,6 @@ ASTScopeImpl *ASTScopeImpl::expandAndBeCurrent(ScopeCreator &scopeCreator) {
945945
ASTScopeImpl *Scope::expandSpecifically(ScopeCreator &) { return this; }
946946

947947
CREATES_NEW_INSERTION_POINT(ASTSourceFileScope)
948-
CREATES_NEW_INSERTION_POINT(ParameterListScope)
949948
CREATES_NEW_INSERTION_POINT(ConditionalClauseScope)
950949
CREATES_NEW_INSERTION_POINT(GuardStmtScope)
951950
CREATES_NEW_INSERTION_POINT(PatternEntryDeclScope)
@@ -958,6 +957,7 @@ NO_NEW_INSERTION_POINT(FunctionBodyScope)
958957
NO_NEW_INSERTION_POINT(AbstractFunctionDeclScope)
959958
NO_NEW_INSERTION_POINT(AttachedPropertyWrapperScope)
960959
NO_NEW_INSERTION_POINT(EnumElementScope)
960+
NO_NEW_INSERTION_POINT(ParameterListScope)
961961

962962
NO_NEW_INSERTION_POINT(CaptureListScope)
963963
NO_NEW_INSERTION_POINT(CaseStmtScope)
@@ -1000,8 +1000,8 @@ ASTSourceFileScope::expandAScopeThatCreatesANewInsertionPoint(
10001000
return {insertionPoint, "Next time decls are added they go here."};
10011001
}
10021002

1003-
AnnotatedInsertionPoint
1004-
ParameterListScope::expandAScopeThatCreatesANewInsertionPoint(
1003+
void
1004+
ParameterListScope::expandAScopeThatDoesNotCreateANewInsertionPoint(
10051005
ScopeCreator &scopeCreator) {
10061006
// Each initializer for a function parameter is its own, sibling, scope.
10071007
// Unlike generic parameters or pattern initializers, it cannot refer to a
@@ -1012,7 +1012,6 @@ ParameterListScope::expandAScopeThatCreatesANewInsertionPoint(
10121012
.constructExpandAndInsertUncheckable<DefaultArgumentInitializerScope>(
10131013
this, pd);
10141014
}
1015-
return {this, "body of func goes under me"};
10161015
}
10171016

10181017
AnnotatedInsertionPoint

0 commit comments

Comments
 (0)