Skip to content

Commit 109d44c

Browse files
committed
[cxx-interop] Emit LValue type in a base subscript assignment expression
This fixes an assertion that tripped when running `member-inline.swift` test with an unrelated patch: ``` type is not an l-value in LHS of assignment: Int32 ... 3. While walking into body of setter for subscript(_:) (in module 'MemberInline') ```
1 parent 0cc2ee1 commit 109d44c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4692,7 +4692,7 @@ synthesizeBaseClassFieldSetterBody(AbstractFunctionDecl *afd, void *context) {
46924692

46934693
auto *argList = ArgumentList::forImplicitUnlabeled(ctx, {paramRefExpr});
46944694
storedRef = SubscriptExpr::create(ctx, pointeePropertyRefExpr, argList, subscript);
4695-
storedRef->setType(subscript->getElementInterfaceType());
4695+
storedRef->setType(LValueType::get(subscript->getElementInterfaceType()));
46964696
} else {
46974697
// If the base class var has a clang decl, that means it's an access into a
46984698
// stored field. Otherwise, we're looking into another base class, so it's a

0 commit comments

Comments
 (0)