mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[TypeChecker] Use the brace statement as the start location of a buildLimitedAvailability call
Otherwise, the call to buildLimitedAvailability has a bigger source range than the brace statement that surrounds it, causing a verification failure.
This commit is contained in:
committed by
Pavel Yaskevich
parent
a59b8bee14
commit
a368f024bb
@@ -1370,9 +1370,9 @@ protected:
|
||||
auto *elseVarRef =
|
||||
builder.buildVarRef(elseVar.get(), elseBraceStmt->getEndLoc());
|
||||
|
||||
auto *builderCall = buildCallIfWanted(
|
||||
ifStmt->getThenStmt()->getEndLoc(),
|
||||
ctx.Id_buildLimitedAvailability, {elseVarRef}, {Identifier()});
|
||||
auto *builderCall = buildCallIfWanted(elseBraceStmt->getStartLoc(),
|
||||
ctx.Id_buildLimitedAvailability,
|
||||
{elseVarRef}, {Identifier()});
|
||||
|
||||
elseVar = captureExpr(builderCall, elseBody);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user