Skip to content

Commit 8fb05af

Browse files
committed
[Constraint solver] Give Bool patterns Bool type.
1 parent 232f20f commit 8fb05af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/CSGen.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2287,11 +2287,13 @@ namespace {
22872287
return subPatternType;
22882288
}
22892289

2290+
case PatternKind::Bool:
2291+
return CS.getASTContext().getBoolDecl()->getDeclaredType();
2292+
22902293
// Refutable patterns occur when checking the PatternBindingDecls in an
22912294
// if/let or while/let condition. They always require an initial value,
22922295
// so they always allow unspecified types.
22932296
case PatternKind::EnumElement:
2294-
case PatternKind::Bool:
22952297
case PatternKind::Expr:
22962298
// TODO: we could try harder here, e.g. for enum elements to provide the
22972299
// enum type.

0 commit comments

Comments
 (0)