@@ -6677,7 +6677,24 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
6677
6677
break ;
6678
6678
}
6679
6679
6680
- default :
6680
+ #define SUGARED_TYPE (Name, Parent ) case TypeKind::Name:
6681
+ #define BUILTIN_TYPE (Name, Parent ) case TypeKind::Name:
6682
+ #define UNCHECKED_TYPE (Name, Parent ) case TypeKind::Name:
6683
+ #define ARTIFICIAL_TYPE (Name, Parent ) case TypeKind::Name:
6684
+ #define TYPE (Name, Parent )
6685
+ #include " swift/AST/TypeNodes.def"
6686
+ case TypeKind::Error:
6687
+ case TypeKind::InOut:
6688
+ case TypeKind::Module:
6689
+ case TypeKind::Enum:
6690
+ case TypeKind::Struct:
6691
+ case TypeKind::Protocol:
6692
+ case TypeKind::ProtocolComposition:
6693
+ case TypeKind::BoundGenericEnum:
6694
+ case TypeKind::BoundGenericStruct:
6695
+ case TypeKind::GenericFunction:
6696
+ case TypeKind::GenericTypeParam:
6697
+ case TypeKind::DependentMember:
6681
6698
break ;
6682
6699
}
6683
6700
@@ -6687,7 +6704,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
6687
6704
// Coercions from a type to an existential type.
6688
6705
case TypeKind::ExistentialMetatype:
6689
6706
case TypeKind::ProtocolComposition:
6690
- case TypeKind::Protocol: {
6707
+ case TypeKind::Protocol:
6691
6708
return coerceExistential (expr, toType, locator);
6692
6709
6693
6710
// Coercion to Optional<T>.
@@ -6709,9 +6726,32 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
6709
6726
diagnoseOptionalInjection (result);
6710
6727
return result;
6711
6728
}
6712
- }
6713
6729
6714
- default :
6730
+ #define SUGARED_TYPE (Name, Parent ) case TypeKind::Name:
6731
+ #define BUILTIN_TYPE (Name, Parent ) case TypeKind::Name:
6732
+ #define UNCHECKED_TYPE (Name, Parent ) case TypeKind::Name:
6733
+ #define ARTIFICIAL_TYPE (Name, Parent ) case TypeKind::Name:
6734
+ #define TYPE (Name, Parent )
6735
+ #include " swift/AST/TypeNodes.def"
6736
+ case TypeKind::Error:
6737
+ case TypeKind::Module:
6738
+ case TypeKind::Tuple:
6739
+ case TypeKind::Enum:
6740
+ case TypeKind::Struct:
6741
+ case TypeKind::Class:
6742
+ case TypeKind::BoundGenericClass:
6743
+ case TypeKind::BoundGenericStruct:
6744
+ case TypeKind::Metatype:
6745
+ case TypeKind::DynamicSelf:
6746
+ case TypeKind::PrimaryArchetype:
6747
+ case TypeKind::OpenedArchetype:
6748
+ case TypeKind::NestedArchetype:
6749
+ case TypeKind::GenericTypeParam:
6750
+ case TypeKind::DependentMember:
6751
+ case TypeKind::Function:
6752
+ case TypeKind::GenericFunction:
6753
+ case TypeKind::LValue:
6754
+ case TypeKind::InOut:
6715
6755
break ;
6716
6756
}
6717
6757
0 commit comments