File tree Expand file tree Collapse file tree 6 files changed +14
-2
lines changed Expand file tree Collapse file tree 6 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 83
83
#define TYPE_RANGE (Id, First, Last )
84
84
#endif
85
85
86
- UNCHECKED_TYPE (Error, Type)
86
+ TYPE (Error, Type)
87
87
UNCHECKED_TYPE(Unresolved, Type)
88
88
ABSTRACT_TYPE(Builtin, Type)
89
89
BUILTIN_TYPE(BuiltinInteger, BuiltinType)
Original file line number Diff line number Diff line change @@ -1313,6 +1313,7 @@ TypeBase *TypeBase::getDesugaredType() {
1313
1313
#define UNCHECKED_TYPE (id, parent ) case TypeKind::id:
1314
1314
#define TYPE (id, parent )
1315
1315
#include " swift/AST/TypeNodes.def"
1316
+ case TypeKind::Error:
1316
1317
case TypeKind::Tuple:
1317
1318
case TypeKind::Function:
1318
1319
case TypeKind::GenericFunction:
@@ -1476,6 +1477,7 @@ bool TypeBase::isSpelledLike(Type other) {
1476
1477
#define UNCHECKED_TYPE (id, parent ) case TypeKind::id:
1477
1478
#define TYPE (id, parent )
1478
1479
#include " swift/AST/TypeNodes.def"
1480
+ case TypeKind::Error:
1479
1481
case TypeKind::Enum:
1480
1482
case TypeKind::Struct:
1481
1483
case TypeKind::Class:
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ static bool isLeafTypeMetadata(CanType type) {
38
38
case TypeKind::ID:
39
39
#define TYPE (ID, SUPER )
40
40
#include " swift/AST/TypeNodes.def"
41
+ case TypeKind::Error:
41
42
llvm_unreachable (" kind is invalid for a canonical type" );
42
43
43
44
#define ARTIFICIAL_TYPE (ID, SUPER ) \
Original file line number Diff line number Diff line change @@ -1005,7 +1005,10 @@ namespace {
1005
1005
llvm::Value *visitInOutType (CanInOutType type) {
1006
1006
llvm_unreachable (" inout type should have been lowered by SILGen" );
1007
1007
}
1008
-
1008
+ llvm::Value *visitErrorType (CanErrorType type) {
1009
+ llvm_unreachable (" error type should not appear in IRGen" );
1010
+ }
1011
+
1009
1012
llvm::Value *visitSILBlockStorageType (CanSILBlockStorageType type) {
1010
1013
llvm_unreachable (" cannot ask for metadata of block storage" );
1011
1014
}
Original file line number Diff line number Diff line change @@ -1155,6 +1155,9 @@ TypeCacheEntry TypeConverter::convertType(CanType ty) {
1155
1155
PrettyStackTraceType stackTrace (IGM.Context , " converting" , ty);
1156
1156
1157
1157
switch (ty->getKind ()) {
1158
+ case TypeKind::Error:
1159
+ llvm_unreachable (" found an ErrorType in IR-gen" );
1160
+
1158
1161
#define UNCHECKED_TYPE (id, parent ) \
1159
1162
case TypeKind::id: \
1160
1163
llvm_unreachable (" found a " #id " Type in IR-gen" );
Original file line number Diff line number Diff line change @@ -230,6 +230,9 @@ namespace {
230
230
RetTy visitInOutType (CanInOutType type) {
231
231
llvm_unreachable (" shouldn't get an inout type here" );
232
232
}
233
+ RetTy visitErrorType (CanErrorType type) {
234
+ llvm_unreachable (" shouldn't get an error type here" );
235
+ }
233
236
234
237
// Dependent types should be contextualized before visiting.
235
238
You can’t perform that action at this time.
0 commit comments