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 {
38103810 AddAttribute (new (ctx) HasStorageAttr (/* isImplicit:*/ true ));
38113811
38123812 if (opaqueReturnTypeID) {
3813+ auto opaqueReturnType = MF.getDeclChecked (opaqueReturnTypeID);
3814+ if (!opaqueReturnType)
3815+ return opaqueReturnType.takeError ();
3816+
38133817 ctx.evaluator .cacheOutput (
38143818 OpaqueResultTypeRequest{var},
3815- cast<OpaqueTypeDecl>(MF. getDecl (opaqueReturnTypeID )));
3819+ cast<OpaqueTypeDecl>(opaqueReturnType. get ( )));
38163820 }
38173821
38183822 // If this is a lazy property, record its backing storage.
38193823 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 ());
38213829 ctx.evaluator .cacheOutput (
38223830 LazyStoragePropertyRequest{var}, std::move (storage));
38233831 }
You can’t perform that action at this time.
0 commit comments