Skip to content

Commit 83e0cfa

Browse files
committed
Assert for unknown structurally uninhabited types
1 parent f085c28 commit 83e0cfa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,6 +2468,9 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
24682468

24692469
if (VD->getInterfaceType()->is<TupleType>()) {
24702470
uninhabitedTypeDiag = diag::pattern_no_uninhabited_tuple_type;
2471+
} else {
2472+
assert(VD->getInterfaceType()->is<EnumType>() &&
2473+
"unknown structurally uninhabited type");
24712474
}
24722475

24732476
TC.diagnose(VD->getLoc(), uninhabitedTypeDiag, VD->isLet(),

0 commit comments

Comments
 (0)