File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -3810,14 +3810,22 @@ class DeclDeserializer {
3810
3810
AddAttribute (new (ctx) HasStorageAttr (/* isImplicit:*/ true ));
3811
3811
3812
3812
if (opaqueReturnTypeID) {
3813
+ auto opaqueReturnType = MF.getDeclChecked (opaqueReturnTypeID);
3814
+ if (!opaqueReturnType)
3815
+ return opaqueReturnType.takeError ();
3816
+
3813
3817
ctx.evaluator .cacheOutput (
3814
3818
OpaqueResultTypeRequest{var},
3815
- cast<OpaqueTypeDecl>(MF. getDecl (opaqueReturnTypeID )));
3819
+ cast<OpaqueTypeDecl>(opaqueReturnType. get ( )));
3816
3820
}
3817
3821
3818
3822
// If this is a lazy property, record its backing storage.
3819
3823
if (lazyStorageID) {
3820
- VarDecl *storage = cast<VarDecl>(MF.getDecl (lazyStorageID));
3824
+ auto lazyStorageDecl = MF.getDeclChecked (lazyStorageID);
3825
+ if (!lazyStorageDecl)
3826
+ return lazyStorageDecl.takeError ();
3827
+
3828
+ VarDecl *storage = cast<VarDecl>(lazyStorageDecl.get ());
3821
3829
ctx.evaluator .cacheOutput (
3822
3830
LazyStoragePropertyRequest{var}, std::move (storage));
3823
3831
}
You can’t perform that action at this time.
0 commit comments