Skip to content

Commit 0595368

Browse files
committed
---
yaml --- r: 245755 b: refs/heads/marcrasi-static-assert c: 2973696 h: refs/heads/master i: 245753: 2208912 245751: 2ce295a
1 parent 69610ba commit 0595368

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-09-20-a: 37a08a7edae5cf9ebde7866dbc974
10711071
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-09-21-a: a47bb052988de099ac2562a50cd1ee60a411e182
10721072
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-09-22-a: 141f61f3c887a81aa5d7a66e843f5e5e9a31ca02
10731073
refs/heads/anotherdayanothercommit: 983c399b25b26d80728c0bf11b12afac852768f6
1074-
refs/heads/marcrasi-static-assert: 83e0cfae0fd0499a98cfb01eb2808e3674bcbf4c
1074+
refs/heads/marcrasi-static-assert: 2973696a24b55191783566f5c06a7a10c1ad0f77
10751075
refs/heads/revert-19500-updateValue-but-not-the-key: b4e27b110af0d7e3002b4f734a347f752d42b9a8
10761076
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-09-25-a: 2ed7952ddd7ef765b60efd13e169ea900ebb5e80
10771077
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-09-26-a: b7cbce34ef0921069091a65e5918640bb382a419

branches/marcrasi-static-assert/lib/Sema/TypeCheckDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2469,7 +2469,8 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
24692469
if (VD->getInterfaceType()->is<TupleType>()) {
24702470
uninhabitedTypeDiag = diag::pattern_no_uninhabited_tuple_type;
24712471
} else {
2472-
assert(VD->getInterfaceType()->is<EnumType>() &&
2472+
assert((VD->getInterfaceType()->is<EnumType>() ||
2473+
VD->getInterfaceType()->is<BoundGenericEnumType>()) &&
24732474
"unknown structurally uninhabited type");
24742475
}
24752476

branches/marcrasi-static-assert/test/decl/var/properties.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,3 +1285,7 @@ var sr8811y: (Int, Never) // expected-error {{variable 'sr8811y' cannot have tup
12851285
var sr8811z: Never {
12861286
return fatalError()
12871287
}
1288+
1289+
enum SR8811EmptyGenericEnum<A> {}
1290+
1291+
let sr8811z: SR8811SR8811EmptyGenericEnum<Int> // expected-error {{constant 'sr8811z' cannot have enum type 'SR8811EmptyGenericEnum<Int>' with no cases}}

0 commit comments

Comments
 (0)