Skip to content

Commit d497c32

Browse files
authored
Merge pull request #1438 from swiftwasm/release/5.3
[pull] swiftwasm-release/5.3 from release/5.3
2 parents af029fd + 1945310 commit d497c32

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

lib/Sema/TypeCheckSwitchStmt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ namespace {
418418
PAIRCASE (SpaceKind::BooleanConstant, SpaceKind::BooleanConstant):
419419
return this->getBoolValue() == other.getBoolValue();
420420

421+
PAIRCASE (SpaceKind::BooleanConstant, SpaceKind::Constructor):
421422
PAIRCASE (SpaceKind::BooleanConstant, SpaceKind::UnknownCase):
422423
return false;
423424

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
3+
// N.B.: Requires a no-asserts build to reproduce, otherwise this hits an
4+
// assertion in type check pattern.
5+
// REQUIRES: no_asserts
6+
7+
indirect enum BadOverload {
8+
case one(Bool, other: Void)
9+
case one(Bool?)
10+
}
11+
12+
func crash(_ x: BadOverload) {
13+
switch $0 {
14+
case .one(false?):
15+
break
16+
}
17+
}
18+

0 commit comments

Comments
 (0)