Skip to content

Commit 0ba2980

Browse files
committed
use new API
1 parent d04663a commit 0ba2980

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,13 @@ static void checkForEmptyOptionSet(const VarDecl *VD, TypeChecker &tc) {
512512
if (!PBD)
513513
return;
514514

515-
auto entry = PBD->getPatternEntryForVarDecl(VD);
516-
515+
auto initIndex = PBD->getPatternEntryIndexForVarDecl(VD);
516+
auto init = PBD->getInit(initIndex);
517+
if (!init)
518+
return;
519+
517520
// Make sure property is being set with a constructor
518-
auto ctor = dyn_cast<CallExpr>(entry.getInit());
521+
auto ctor = dyn_cast<CallExpr>(init);
519522
if (!ctor)
520523
return;
521524
auto ctorCalledVal = ctor->getCalledValue();

0 commit comments

Comments
 (0)