Skip to content

Commit b19bae4

Browse files
committed
Import the value of a subscript setter as owned
The translation from a bit to the specifiers exposed this instance in the Clang importer where we hooked up a parameter as mutable but never reflected that in the interface type. A future patch requires that this parameter be immutable.
1 parent ac56f91 commit b19bae4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ static FuncDecl *buildSubscriptSetterDecl(ClangImporter::Implementation &Impl,
15011501
auto elementTy = dc->mapTypeIntoContext(elementInterfaceTy);
15021502

15031503
auto paramVarDecl =
1504-
new (C) ParamDecl(VarDecl::Specifier::InOut, SourceLoc(), SourceLoc(),
1504+
new (C) ParamDecl(VarDecl::Specifier::Owned, SourceLoc(), SourceLoc(),
15051505
Identifier(), loc, valueIndex->get(0)->getName(),
15061506
elementTy, dc);
15071507
paramVarDecl->setInterfaceType(elementInterfaceTy);

0 commit comments

Comments
 (0)