Skip to content

Commit e731dd0

Browse files
authored
Merge pull request #16820 from CodaFi/the-deep-state
[NFC] Drop mutability from parameter context changes
2 parents a280c5b + 28a8fb1 commit e731dd0

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

include/swift/AST/Initializer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class DefaultArgumentInitializer : public Initializer {
162162
/// Change the parent of this context. This is necessary because
163163
/// the function signature is parsed before the function
164164
/// declaration/expression itself is built.
165-
void changeFunction(DeclContext *parent, MutableArrayRef<ParameterList *> paramLists);
165+
void changeFunction(DeclContext *parent, ArrayRef<ParameterList *> paramLists);
166166

167167
static bool classof(const DeclContext *DC) {
168168
if (auto init = dyn_cast<Initializer>(DC))

include/swift/Parse/Parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ class Parser {
10251025

10261026
/// Set the parsed context for all the initializers to the given
10271027
/// function.
1028-
void setFunctionContext(DeclContext *DC, MutableArrayRef<ParameterList *> paramList);
1028+
void setFunctionContext(DeclContext *DC, ArrayRef<ParameterList *> paramList);
10291029

10301030
DefaultArgumentInfo(bool inTypeContext) {
10311031
NextIndex = inTypeContext ? 1 : 0;

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4554,7 +4554,7 @@ void ParamDecl::setDefaultArgumentInitContext(Initializer *initContext) {
45544554
}
45554555

45564556
void DefaultArgumentInitializer::changeFunction(
4557-
DeclContext *parent, MutableArrayRef<ParameterList *> paramLists) {
4557+
DeclContext *parent, ArrayRef<ParameterList *> paramLists) {
45584558
if (parent->isLocalContext()) {
45594559
setParent(parent);
45604560
}

lib/Parse/ParsePattern.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static DefaultArgumentKind getDefaultArgKind(Expr *init) {
5757
}
5858

5959
void Parser::DefaultArgumentInfo::setFunctionContext(
60-
DeclContext *DC, MutableArrayRef<ParameterList *> paramList){
60+
DeclContext *DC, ArrayRef<ParameterList *> paramList){
6161
for (auto context : ParsedContexts) {
6262
context->changeFunction(DC, paramList);
6363
}

0 commit comments

Comments
 (0)