mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
If a shared case block dest got created before it's case's pattern vars were
initialized, the block arg could get created with the type from an outer scope.
This commit is contained in:
@@ -2292,7 +2292,7 @@ JumpDest PatternMatchEmission::getSharedCaseBlockDest(CaseStmt *caseBlock,
|
||||
pattern->forEachVariable([&](VarDecl *V) {
|
||||
if (!V->hasName())
|
||||
return;
|
||||
block->createPHIArgument(SGF.VarLocs[V].value->getType(),
|
||||
block->createPHIArgument(SGF.getLoweredType(V->getType()),
|
||||
ValueOwnershipKind::Owned, V);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user