File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ class SILModule {
473
473
SingleValueInstruction *
474
474
getRootLocalArchetypeDefInst (CanLocalArchetypeType archetype,
475
475
SILFunction *inFunction) {
476
- return cast <SingleValueInstruction>(
476
+ return dyn_cast <SingleValueInstruction>(
477
477
getRootLocalArchetypeDef (archetype, inFunction));
478
478
}
479
479
Original file line number Diff line number Diff line change @@ -1703,6 +1703,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
1703
1703
// the current function.
1704
1704
auto *openingInst = F.getModule ().getRootLocalArchetypeDefInst (
1705
1705
root, AI->getFunction ());
1706
+ require (openingInst,
1707
+ " Root opened archetype should be registered in SILModule" );
1706
1708
require (openingInst == AI || properlyDominates (openingInst, AI),
1707
1709
" Use of a local archetype should be dominated by a "
1708
1710
" definition of this root opened archetype" );
You can’t perform that action at this time.
0 commit comments